pixel

I'd like to draw pixels on a window with mouse input

末鹿安然 提交于 2019-12-11 13:54:48
问题 I've done days of searching for a way to draw pixels to a window in java with mouse capture. I'm looking for some framework I can just plug in. It seems like it would be so simple... Any help will be greatly appreciated. (EDIT) Here is some non-working code. public class Base extends JPanel implements MouseMotionListener { public static void main(String[] args) { new Base(); } final static int width = 800; final static int height = 600; BufferedImage img; Base() { img = new BufferedImage

Get pixel color in sceneKit View, iOS, Swift

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 13:23:30
问题 I try to get the color of a specific pixel in my sceneKit view. However, I only get the color of my background. In my scene I have a sphere with an image on the texture. Can somebody help me? import UIKit extension UIView { func getColourFromPoint(point:CGPoint) -> UIColor { let colorSpace:CGColorSpace = CGColorSpaceCreateDeviceRGB()! let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.PremultipliedLast.rawValue) var pixelData:[UInt8] = [0, 0, 0, 0] let context = CGBitmapContextCreate(

Get Pixel Color around an image

▼魔方 西西 提交于 2019-12-11 11:44:18
问题 I have an image, and I figured out how to use robot and getPixelColor() to grab the color of a certain pixel. The image is a character that I'm controlling, and I want robot to scan around the image constantly, and tell me if the pixels around it equal a certain color. Is this at all possible? Thanks! 回答1: Myself, I'd use the Robot to extract the image that's just a little larger than the "character", and then analyze the BufferedImage obtained. The details of course will depend on the

Imshow - splitted with different pixel sizes

旧街凉风 提交于 2019-12-11 10:43:19
问题 I try to get the following which should be illustrated in the figure below. Let us assume, for simplicity, I have a numpy array (10x10) which I want to plot with matplotlib imshow. The condition is to have different pixel sizes, for instance: the first five rows should have a size of 0.5cm the last five rows should have a size of 1cm. The columns should have the same size. How could I easly implement this? I already tried to do this, but I do not like this solution; in particular I still have

iPhone - Replacing a block of pixels in an image with another block of pixls

笑着哭i 提交于 2019-12-11 09:27:18
问题 I would like to know if anyone can point me in the right direction regarding what frameworks/methods to use when replacing a block of pixels in an image with another block of pixels. For example lets say I have a simple image colored fully red and I consider my pixel block size as 5x5 pixels. Now every 3 blocks I want to replace the 3rd block with a blue colored block (5x5 pixels) so that it would result in a red image with blue blocks appearing every 3 red blocks. I've found information

how do I get a consistent javascript window.outerHeight cross browser?

冷暖自知 提交于 2019-12-11 08:58:30
问题 Maybe this is a noob question but... I have a site where I want the footer to appear in the same place all the time. Assuming my users are all on >= IE8, Chrome and Firefox I figured it was just a question of getting the Window.outerHeight. But when I measure the window.outerHeight it returns different values in FF v. Chrome v. IE. Plus, just doing some basic measurements visually, it's clear that a 500px DIV is not the same height on my monitors in Chrome as in FF as in IE. SO: Is there some

Render 16 bits image in picturebox

怎甘沉沦 提交于 2019-12-11 07:54:00
问题 I have an array which consists in PixelData extracted from a Dicom Image. Here's the code: byte[] bytes = img.PixelData.GetFrame(0).Data; // img is the Dicom Image int count = bytes.Length / 2; ushort[] words = new ushort[count]; for (int i = 0, p = 0; i < count; i++, p += 2) { words[i] = BitConverter.ToUInt16(bytes, p); } pixels16 = words.ToList(); //pixels16 contains now the PixelData for the Grayscale image Now, here's my question, how do I render that into a Picturebox?? 回答1: My code for

optical aspect ratio not consistent with supportedPictureSizes

有些话、适合烂在心里 提交于 2019-12-11 07:46:30
问题 I have discovered that certain tablets (e.g. Samsung SM-T210 - Galaxy Tab 3) have equal horizontal and vertical angles of view (implying aspect ratio = 1), while NONE of their camera1.parameters supported picture sizes have an aspect ratio of 1 (closest being 1.33). What's going on? Are pixel pitches different in the x and y directions? Is come kind of cropping always applied? I am testing an augmented reality app, and I need to have a very clear understanding of how an optical point maps

Minor image differences in image manipulation program

旧时模样 提交于 2019-12-11 06:38:07
问题 I've implemented a method that takes an input image and flips it around a vertical line through the center and saves it to an output image file. So whats on the left becomes on the right and vice versa. The image looks great and looks like it flipped perfectly. However, we are given the actual flipped image file that its supposed to look like, and I used the diff utility in terminal to compare the two, and it states that there are indeed differences. Using a program called Kaliedoscope, I was

Actionscript 3 pixel perfect collision. How to? (learning purposes)

前提是你 提交于 2019-12-11 05:33:29
问题 I know that there are people out there creating classes for this (ie http://coreyoneil.com/portfolio/index.php?project=5). But I want to learn how to do it myself so I can create everything I need the way I need. I've read about BitMap and BitMapData. I should be able to .draw the MovieClips onto a BitMap so I could then cycle the pixels looking for the collisions. However, It's weird and confusing dealing with the offsets.. And it seams like the MyBitMap.rect has always x = 0 and y = 0...