Question

I've selected an 8bpp bitmap into a CDC, and used ::TextOut () to draw text. The font quality is ANTIALIASED_QUALITY, but the text comes out in monochrome; no gray pixels & jagged edges.

The 8bpp bitmap was extracted from a 24bpp bitmap that already had antialiased text drawn on it, and THAT text is ok. (Both text types are in the same bitmap.)

Of course I could draw on 24bpp and convert, but this is more complex and slow. (The later text changes, and is repeated many times.) Is it possible to get antialiased text directly into an 8bpp bitmap? Thanks!

Was it helpful?

Solution

No, anti-aliasing doesn't work with 8-bpp. If you need faster updates, consider doing your drawing with something like OpenGL instead of via GDI. With OpenGL, the drawing will normally be done entirely by the graphics hardware, so even at 32-bpp, the drawing will usually be faster than GDI doing 8-bpp.

It's also worth noting that you'd probably be better off with 32-bpp than either 8- or 24-bpp in any case. GDI can use (some) hardware acceleration, but it's usually at its best with 32-bpp.

OTHER TIPS

No, GDI does not do antialiased output to a paletted bitmap, and that's exactly what a grayscale bitmap is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top