![]() ![]() We could declare a set of each possible combination (8 x 8 = 64), e.g. $55 = 01010101 binary for black & white stripes 103k 8 8 gold badges 267 267 silver badges 370 370 bronze badges. So if we're going to use a pByteArray we basically need to read in a 'row' of 8 pixels, determine which are black and white and then give it a byte value representing this combination, e.g. White black white black white black white black What we really want is an array of BITS, not bytes - and that's what I can't find an example for on google - I have examples of doing this by reading each BYTE, and for example if you want The problem seems that Row is declared thus: PBitmapInfo->bmiColors.rgbBlue = (BYTE) nIndex ī(447): Constant expression violates subrange bounds PBitmapInfo->bmiColors.rgbGreen = (BYTE) nIndex PBitmapInfo->bmiHeader.biClrImportant = 256 įor(SIZE_T nIndex = 0 nIndex bmiColors.rgbRed = (BYTE) nIndex PBitmapInfo->bmiHeader.biSizeImage = 240 * 320 PBitmapInfo->bmiHeader.biCompression = BI_RGB PBitmapInfo->bmiHeader.biSize = sizeof pBitmapInfo->bmiHeader We got it work by using Photoshop to save an image into a grayscale 8 bit bitmap (we tried saving it as an 8-bit color bitmap but vision assistant kept. Optimized conversion of color and grayscale image to a bi-tonal image. ZeroMemory(pBitmapInfo, nBitmapInfoSize) hi there here it is my code: procedure TForm4.Button1Click(Sender: TObject) var png: TPNGImage data: PRGBQarray. Public Method, AdvancedBinarize, Overloaded. high resolution details of grayscale images while maintaining high compression ratios. ![]() PBitmapInfo.AllocateBytes(nBitmapInfoSize) Procedure ALStrecth to stretch a bitmap using lanczos3 by example. CWindowDC DesktopDc(NULL) ĪTLVERIFY(BitmapDc.CreateCompatibleDC(DesktopDc)) Ĭonst SIZE_T nBitmapInfoSize = sizeof (BITMAPINFO) + 256 * sizeof (RGBQUAD) Here is the code snippet (in C++, ATL and WTL - but you should get the idea). Ī single GDI BitBlt into this bitmap will grey your original image out. ![]() You can create a paletted DIB Section, 8 bits per pixel and 256 colors, and initialize palette to shades of grey. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |