How can you select a region into a DC ? Region can only be selected as clipping region, meta region, or used in PaintRgn directly.
Feng Yuan
Posts
-
Creating circular background image with transparency -
How to get video driver version?Try: EnumDisplayDevices
-
How to get video driver version?Try: EnumDisplayDevices
-
SEH problem in release modeAs you said, compiler optimization in release mode may have removed the divide-by-zero.
-
RGB to 5.6.5 translation?( (GetRValue(cr) >> 3) << 11 ) | ( (GetGValue(cr) >> 2) << 5 ) | (GetBValue(cr) >> 3)
-
Stretching Bitmap ProblemhBmp should be selected into srcMemDC. Destination bitmap missing.
-
LoadImage not loading animated cursor from resources when statically linking to MFCConvert the image to one of the closest DIB format, and then use StretchDIBits to display it. My guess is that each pixel is a 16-bit grayscale level, so the closest DIB format would be 8-bit grayscale image, or a 256-color DIB with a grayscale color table. Setup a BITMAPINFO structure with a 256-color grayscale color table, convert the image array to a 64x64 BYTE array, and then use StretchDIBits to display it.
-
Unicode Character Rendering in 95/98You can use ExtTextOut and glyph index to display any glyph in a font; Or you can use TextOutW or ExtTextOutW to display UNICODE string without using glyph index. http://www.amazon.com/exec/obidos/ASIN/0130869856
-
Finding bitmap resourcesFindResource, LoadResource, and LockResource gives you a pointer to read-only data.
-
metafile to bitmapSelect bitmap into the memory DC before drawing.
-
number of control on a dialog resourceSounds like a bug in the IDE, edit the .rc file yourself.
-
Process-AdressEach Win32 process has its own independent address space, of which only the upper part is shared system wide. For example, address 0x10000000 can point to different data in process1 vs. process2. http://www.amazon.com/exec/obidos/ASIN/0130869856
-
metafile to bitmapCreate a DIB section and a memory DC, select the DIB section into the memory DC, play the metafile into memory DC, now you got a bitmap in the DIB section. http://www.amazon.com/exec/obidos/ASIN/0130869856
-
Serialize a CRgn?DWORD size = GetRgnData(hRgn, 0, NULL); RGNDATA * pData = (RGNDATA *) new BYTE[size]; GetRgnData(hRgn, size, pData); WriteFile(hFile, ,,, pData, size,,,); delete [] (BYTE *) pData;