GetPixel is a Windows GDI API function which retrieves the RGB color value of the pixel at a specific coordinates.
Questions tagged [getpixel]
199 questions
1
vote
0 answers
CopyFromScreen and GetPixel performance issues
I am using a GetPixel function to take a pixel from the screen and return its colour:
int GetPixel(int X, int Y)
{
Bitmap bmp = new Bitmap(1, 1, PixelFormat.Format32bppPArgb);
Graphics grp = Graphics.FromImage(bmp);
…

Pedro Barros
- 13
- 3
1
vote
0 answers
Android Bitmap.getPixel() Is Annoyingly Inaccuracte
Project OverView : Theres two images. Click the top image (in my app i use a cat pic) and it will set the bottom image background to the color of the pixel on the location you clicked at.
The Problem: The background color doesn't match the color of…

Witch
- 25
- 1
- 6
1
vote
0 answers
how to get all RGB values from a pixel in Python?
When I run this code, I get a single value for the pixel,now I don't know what the single value represents..red, green, blue, or some average of them all.
I was wondering how I can get all the values of RGB separate, like in a tuple or some other…

Teemo
- 11
- 1
1
vote
0 answers
get color of each pixel from sl::zed::Mat
i have a variable sl::zed::Mat and i want to get color of each pixel from that Mat. i was tried using getValue(x,y) to get 3 channels, but i can't get reach the value over 50.
here's my codes:
sl::zed::Mat color = data->_color;
sl::uchar3 bgrPixel…

Aziz Nurfalah
- 11
- 5
1
vote
2 answers
How to copy pixels from one bitmap to another shaped like a circle?
I am using setPixel and getPixel functions but they are using matrices which is naturally rectangle.I am trying to copy pixels shaped like circle !
update :
now i am using this but i hope there is something more efficient than this one :
for(int…

Tony
- 1,603
- 3
- 21
- 40
1
vote
1 answer
COLORREF as RGB or hexadecimal
I have my current code that reads the GetPixel from the current cursor position but the return value is just some insane value by COLORREF and I want it to be in RGB. I looked into Microsoft Reference and I found RGB Macro
COLORREF RGB(
BYTE…

Matthew Mackday
- 65
- 1
- 1
- 6
1
vote
1 answer
Aforge.NET - Get items from StringBuilder
I'm creating a program that is designed to check multiple choice tests. My application is meant squares which will search the pixels of a different color than the background color (white). Stringbuilder I used to line up the position of individual…

k1dl3r
- 103
- 1
- 2
- 11
1
vote
1 answer
GetBValue Error: Expression must have integral or unscoped enum type
I am writing a simple program to read the pixel at a particular location and get its individual R,G and B values for further processing.
I am able to read the R and the G values but I get an error when I read the B value.
Here is my complete code…

newbie2015
- 581
- 5
- 29
1
vote
1 answer
How to display bmp color value on TextView
I want to get a color value bmp image is displayed on Textview
This is my bmp image, size 16X24
I tried to do a button when the button is pressed bmp image color values will be displayed in the TextView
But after pressing a button the program…

Ban Lin
- 95
- 2
- 10
1
vote
1 answer
getPixel() giving 0 for PNG Bitmap:Android
I am facing this problem for 2 days now. I am making a 2D game via Canvas and it has a PNG file which I am drawing on the canvas by drawBitmap(), and it works fine.
But for Per-Pixel-Collision detection, I am using getPixel(), but it's always…

Sucho
- 321
- 1
- 14
1
vote
1 answer
How do I correct this LockBits math error?
Using GetPixel/SetPixel, I was using the following to power an image filter that emphasizes reds and purples:
for (int y = 0; y < bmpMain.Height; y++)
for (int x = 0; x < bmpMain.Width; x++)
{
bmpMain.GetPixel(x, y);
Color c…

MaoTseTongue
- 71
- 2
- 8
1
vote
0 answers
Get pixel colors from an Image?
I was trying to create an app which can get the pixel colors of an image. I successfully created a camera app which can take a photo and it infuse an ImageView.
So far my idead is working, but I don't know how should I retrieve a pixel color. I was…

Mistic
- 41
- 4
1
vote
2 answers
C# Problem with getPixel & setting RTF text colour accordingly
Heyo, I'm messing with converting images to ASCII ones. For this I load the image, use getPixel() on each pixel, then insert a character with that colour into a richTextBox.
Bitmap bmBild = new Bitmap(openFileDialog1.FileName.ToString()); //…

pastapockets
- 1,088
- 2
- 13
- 20
1
vote
2 answers
Determine if getPixel() value is greater than or less than 50% gray
I am trying to loop through a bitmap and determine if each pixel is lighter or darker than gray using getPixel(). Problem is, I am not sure how to tell whether the value returned by getPixel() is darker or lighter than gray.
Neutral gray is about…

cmal
- 1,751
- 5
- 18
- 29
1
vote
0 answers
Getting pixel color from bitmap (javascript) not working
I am working on a simple game using Three.js on javascript. I need to use a bitmap to create the scenario. My bitmap is basically a 15x15 pixel
All I want to do is get the rgb value for every pixel on this image. This is the code I have so…

user3758765
- 11
- 2