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
0
votes
1 answer

My GetPixel function is very slow, am I using the right way to do it?

def get_pixel_colour(self, i_x, i_y): i_desktop_window_id = win32gui.GetDesktopWindow() i_desktop_window_dc = win32gui.GetWindowDC(i_desktop_window_id) long_colour = win32gui.GetPixel(i_desktop_window_dc, i_x, i_y) i_colour =…
Michael C
  • 135
  • 1
  • 1
  • 12
0
votes
1 answer

Get Texture Pixels using Rect coordinates

I have this one problem, I want to get the texture pixels in Unity using Rect coordinates, so something like this: Get all the pixels from the marked area. I know that x: 0 and y: 0 is at the bottom left corner, when you're trying to get the…
UnknownUser
  • 327
  • 2
  • 14
0
votes
1 answer

How can I read every pixel of a WritableImage with Raster?

I have to write a method that: Create a histogram read all pixel values from grayscale images (variable width and height) fill the histogram How can I do it? I wrote a bit of code but I'm deadlocked. public histogram(BufferedImage image){ …
Leon Zak
  • 13
  • 6
0
votes
1 answer

ASP.NET : Get PixelColor on mouse click on asp.net page

I have an asp.net page which displays different colors..It looks something like this. Now what i want is,when i click on any where in that form,i want to get the pixel color of that particular point. How can i do that??
Shijilal
  • 2,175
  • 10
  • 32
  • 55
0
votes
0 answers

Win32 GetPixel() returns wrong values whereas SetPixel() works fine, even when DPI awareness is turned on

I have been struggling with this issue for the entire day and I am still not making any progress. CONTEXT I am trying to reproduce a virtual piano keyboard (driven with MIDI files) on LEDs attached to a physical keyboard so that my wife can learn…
Mister Mystère
  • 952
  • 2
  • 16
  • 39
0
votes
0 answers

C# Redraw/recreate an image externally with a brush tool

Phew, first burden here is to explain what I'm looking for within a short title. Basically, I want to improve my existing pixel draw bot. Main objective: It needs to be fast. I am fairly content with its performance for now, but it can be better.…
0
votes
1 answer

IF Bitmap was found

I'm trying to detect with the bitmap if it's my first turn or second turn (since it's a coin toss and it shows red or blue), but I'm having trouble making an IF argument. I tryed some things and none seemed to work... private void…
ThyThal
  • 1
  • 3
0
votes
1 answer

How to get pixel color in a certain area

I have to implement a function in an Android application that return to me the color in a certain area of a image. What I need is different from what the getpixel() - Returns the color at the specified location because I need to determine the…
Mattia
  • 1,057
  • 2
  • 17
  • 33
0
votes
0 answers

Getting pixel space coordinates correct for an image capture in Unity

I'm wanting to set up an area on my screen for a screen capture using ReadPixels but I'm unsure how the pixel space coordinates. Based on a 825 x 825 pixel square that is 215 pixels from the left and 134 pixels up from the bottom. How would I enter…
greyBow
  • 1,298
  • 3
  • 28
  • 62
0
votes
0 answers

Algorithm for moving pixels in bulk?

Currently i'm trying to produce a simple 2D map generation program, and it is pretty much finished apart from one key thing; The movement of the generated islands. The way the program functions it keeps all the islands in the middle of the map…
0
votes
1 answer

java robot.getPixelColor(x,y) question

First off the code: for (int i = 0; i < 25; i++) { robot.delay(1000);// wait 1 second Color pixel_4 = robot.getPixelColor(x-15, 30); System.out.println(pixel_4.getRed() + " " + pixel_4.getGreen() + " " + pixel_4.getBlue()); } That is not the exact…
Dream Lane
  • 1,282
  • 5
  • 16
  • 27
0
votes
1 answer

How to assign a pixel a value, then get that value's coordinates

I'm only a couple weeks into my IT degree and I'm trying to write a small program in Python, I've tried searching for a solution but my knowledge of terminology and concepts is probably limiting my results. Saying that, I'm trying to find out if it…
0
votes
1 answer

Not able to successfully use lockbits

Hi i m really new in image processing in C# and the code below basically getpixel from the image I browsed from my computer and will compare the RGB value of the pixel with the right pixel and if its the same value, it will setpixel to cyan color.…
LouisL
  • 121
  • 1
  • 1
  • 11
0
votes
1 answer

Take pixels from input image (subsampling of image pixels)

How to take pixels from an input image by using Gaussian sub-sampling (shotgun pattern like)? I want to take the locations of pixels that are to be taken like in a shotgun pattern concentrated in the middle of the image. Because I do not want to…
S.EB
  • 1,966
  • 4
  • 29
  • 54
0
votes
1 answer

Unity: Getting the pixel on an image based on the location of buttons above the image

For my 2D Game; I have a panel with an image Component (with a sprite) and a GridLayout component. On the panel i have also put a script that creates buttons for the panel (as children) public void InitializeGrid(int rows, int columns,…
DennisVA
  • 2,068
  • 1
  • 25
  • 35