milipilot.blogg.se

8bit image converter
8bit image converter








If you pass in a 24-bit bitmap to be converted to 8-bit gray, you won't have a valid source palette to copy, since 24-bit formats aren't indexed. Rectangle rect = new Rectangle(0, 0, this.Width, this.Height) īitmapData bmpData = m_bmp.LockBits(rect, .WriteOnly, pixelFormat) // LOCKED M_bmp = new Bitmap(this.Width, this.Height, pixelFormat) PixelFormat = PixelFormat.Format24bppRgb PixelFormat = PixelFormat.Format8bppIndexed Throw new InvalidOperationException("Internal image data does not exist!") / returns a 8bppGrey or 24bppRgb Bitmap Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height) copy bmp matrix without padding to rgb or grey array

8BIT IMAGE CONVERTER CODE

The code i use to convert the image is as follows: public myImage(Bitmap bmp, myImageFormat format) My problem is that i need the picture for measurements afterwards. This happens only if i covert them into the myImage/myImageFormat. Therfore i need it the picture to get grayscaled because of daterate issues, but i only get this wrongly sized and collored picture. My plan is to display a GigE-Cam with my program through a client-server implementation.

8bit image converter 8bit image converter

My problem is when is take a 8bit greyscaled image and convert it into an 24bit rgb24bpp my image gets zoomed in and the colorscale get mixed up( see 3).








8bit image converter