[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
How to draw images in Microwindows/Nano-X
From: Greg Haerr ####@####.#### Date: 25 Jan 2000 23:36:09 -0000 Message-Id: <C1962B36D9BBD311B0F80060083DFEFB0419CA@SYS.CenSoft.COM> On Tuesday, January 25, 2000 2:33 PM, Kyle Harris wrote: : Speaking of all this image handling and optimizations..... : : What is the preferred method (i.e., fastest) for putting an image on the : screen? Do I draw to a memory psd first, followed by GdBlit(), or some : other procedure? : : Thanks, Kyle. In Microwindows: DrawImage(PIMAGEHDR image,HDC hdc,...) This will draw a pre-defined image structure (color palette and pixels) onto a memory or physical screen. In the case of 8bpp display, it automatically enlarges the physical palette. In Nano-X there are two options: Monochrome bitmaps are displayed with GrBitmap(), and color bitmaps with GrArea(). In Nano-X, bitmaps are less sophisticated, merely packed pixels, never with any color information associated with them. Palette reorganization is the applications' problem. Drawing to memory and then blitting to screen is always slower, but is required if to avoid flickering in some circumstances. To draw to offscreen memory in Microwindows: memdc = CreateCompatibleDC(NULL); // create memdc hbmp = CreateCompatibleBitmap( hdc, x, y); SelectObject(memdc, hbmp); // draw into memdc // blit to screen BitBlit(ScreenDC, x, y, w, h, memdc, 0, 0, SCR_COPY); Currently, Nano-X doesn't support off-screen drawing, but it's coming. Regards, Greg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |