Questions tagged [getpixel]

GetPixel is a Windows GDI API function which retrieves the RGB color value of the pixel at a specific coordinates.

199 questions
1
vote
1 answer

How to get pixels from window using Direct2D

My problem is getting the pixels in a window. I can't find a way to do this. I using standard windows functions and Direct2D (not DirectDraw). I am using standard initialization of new window: WNDCLASS wc; wc.style = CS_OWNDC; wc.lpfnWndProc =…
Divergence
  • 11
  • 2
1
vote
1 answer

Get X & Y Coordinates of Camera Focus

I would like to ask a question related to the camera live view. When we tap somewhere on the camera preview, a focus appears. How should I get the X & Y coordinates or pixel of that focus? Thanks in advance.
Vera Aung
  • 85
  • 1
  • 1
  • 10
1
vote
1 answer

Visual Basic 2008 , Search for an image on my desktop ( getpixel way/ comparing pixels)

i'm a young "programmer" and i'm trying to make a code that searches if a 400 x 500 image (a bmp file from my computer ) appears on the screen . The code looks like this : Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object,…
1
vote
1 answer

unity comparing getpixel to color

What I want to do is loop through the picture checking for pixels of specific color and count them. This is cruical for my project. So the problem is that comparing GetPixel to Color never returns true even if the colors are the same. I tested it…
user3015088
  • 33
  • 1
  • 4
1
vote
1 answer

Android: getPixel(x,y) colour values are wrong

I'm an android/java newbie and am developing a simple app that will generate harmonious colours from a colour picked from a colour wheel. The problem is that I can't even get the right colour to appear in a box below the wheel (touching yellow on…
tansz
  • 13
  • 4
1
vote
2 answers

Getting the coordinates from a point from an image

I am creating a program that can print out the x- & y- Coordinates from a certain pixel. There is a function like 'GetPixel', this will however get the RGB codes from a given coordinate. What I want is just the vice versa, so I have already the RGB…
user2754279
  • 115
  • 1
  • 3
  • 10
1
vote
1 answer

Is there a faster way to compare NSBitmapImageRep objects pixel by pixel?

I'm trying to speed up some code that i wrote a while back. Using instruments in Xcode I've found that the major bottleneck is in this method, in particular the getPixel call. - (BOOL)fasterCompareImage:(NSBitmapImageRep *)imageRepA…
1
vote
1 answer

Android Getting Correct Pixel from Bitmap

I have a bitmap of temperatures across the US that gets displayed as a map overlay. That part works fine- the Bitmap temperature overlay sits perfectly on the map relative to borders and geographic points. My goal is to be able to tap this…
1
vote
2 answers

Why GetPixel() is so slow using Ruby (or probably Perl or Python too) and how to do it by other methods?

I tried using Win32's GetPixel() with Ruby and it is really slow even on a Quad Core Intel machine. I think for example, if I get a really small region such as 100 x 10 pixels = 1000 pixels and it can take 30 seconds to complete. Is there a better…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
1
vote
3 answers

getPixel-method - how do i get the R value of RGB?

i have a greyscale image and i want to scan the pixels out of the Image and this is what i get : var i:int; var j:int; for (i = 0; i < img.contentWidth ; i++) { for(j = 0; j < img.contentHeight; j++){ …
n00ki3
  • 14,529
  • 18
  • 56
  • 65
1
vote
2 answers

Increasing image width by one pixel

I am trying to implement a program, that will increase the width of an image by one pixel. I then want to take the new maximum x ordinate and put this with a random y ordinate (that is within the range of the image) to create a new pixel. for x in…
user3956566
1
vote
1 answer

Read pixels from screen

I am trying to read a graphic clock from my screen, but it's too slow. The part of the code posted is only for one number of 10 , and 6 positions. self.pp is to add an offset. Is there a faster way to do this, where I can use all the coordinates…
user2487237
  • 11
  • 1
  • 2
1
vote
2 answers

How to determine whether colour is within a range of shades

I am not sure if this is possible as I have been looking for a few hours and cant find what I am looking for. What i am doing is taking a color from a game panel which is semi translucent so the color which I am taking is always subtly changing.…
user2443215
  • 11
  • 1
  • 2
1
vote
1 answer

iOS programatic screenshot of single pixel

I am trying to get the RGBA colour of a single pixel programatically on an iOS device. I currently have a method, however it involves taking a screenshot of the whole screen and then finding the RGB colour of the central pixel, because I want to…
simonthumper
  • 1,834
  • 2
  • 22
  • 44
1
vote
1 answer

Getpixel() from external window handle MFC

I have window handle and I need get pixel color. #include "Globals.h" void MainHamsterDlg::OnTimer(UINT nIDEvent) { Sleep(4000); HDC hDC = ::GetDC(tempHWND); COLORREF rgb = GetPixel(hDC,351,515); …
Klasik
  • 872
  • 1
  • 9
  • 29