visual studio 2010 - How do I set my palette to grayscale in c++ -
I am reading a live feed from a mono camera and need to take a snapshot when pressing a button. If I convert, the camera sends me a bitmap (8 bpp) for further image processing, so the color becomes all odd in this way
I'm guessing because I use bitmap Is not set correctly, so I googled something and came in some code in VB, which sets the bitmap color palette for Gray Scale, I want to do the same in C ++ under Visual Studio 2010, only The constructor of the color palette has been turned off in C ++, thus I have no way of declaring a new grayscale palette and then assign it to my bitmap.
Below I have the example code written in Visual Basic:
Dim BMPB as the system in the form of Bitmap DIIL Pal. Drawing Imaging Coloreplet pal = BMPob Palette I = 0 to 255 pal.Entries (i) = Color.FromArgb (i, i, i) Next bmpobj.Palette = pal
So what I am asking is this: By the way Also set my bitmap palette to grayscale?
I think, by changing just the color palette, your image will not change in gray scale. / P>
You have to change the color pixels of the image in gray scale. .
Comments
Post a Comment