This is a discussion on GRB Value within the C# Programming forums, part of the Software Development category; Hi, I am working on project where I have to calculate the value RGB value of particular pixel. I make ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, I am working on project where I have to calculate the value RGB value of particular pixel. I make a function in C#. Please check, Is there any error in function. What I am trying to get is pass the cordinate of X and Y and I want the corresponding RGB value of particular Cordinate. Code: Public Double GetRGBValue(int X, int Y)
{
Bitmap grayscale=(Bitmap)pioOriginal.Image.Clone("Path of Image Saved");
Color color = grayscale.GetPixel(X,Y);
Double graycolorVal= (color.R + Color.G + color.B)/3;
Return graycolarVal;
} And I want to call like this: lbl.text=GetRGBValue(144,49); |
| Sponsored Links |
| |||
| Can you plz figure out the error message you are facing? and GetRGBValue() function returns a double value and in the below line you are storing the return value in lbl.text which accepts only string. lbl.text=GetRGBValue(144,49);
__________________ $enthil |
| |||
| Try this function Quote:
Double rgbval = GetRGBValue(150,10); |
| |||
| if i get the value from all pixels of an image ..for change the effects of an image....it should be slow right? Last edited by kingmaker : 01-20-2008 at 08:19 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
| |