Declare the Function GdipCreateBitmapFromGraphics Lib "gdiplus" (ByVal Width As Long, ByVal Height As Long, ByVal graphics As Long, bitmap As Long) As GpStatus
Dim bitmap As Long, graphics As Long
Dim color As Long
InitGDIPlus
GdipCreateFromHDC Me. HDC, graphics
GdipGraphicsClear graphics, & amp; HFFFF0000 'red background
GdipCreateBitmapFromGraphics 100, 100, graphics, bitmap 'create a copy of an existing
GdipBitmapGetPixel bitmap, 0, 0, color 'color
The Debug. Print Hex (color)
GdipDeleteGraphics graphics
GdipDisposeImage bitmap
TerminateGDIPlus
The key code is more than these
From the Graphics to create Bitmap
But in the end no matter how to color is 0
If use is normal from image files to create Graphics
For the great god help see where there is a problem
CodePudding user response:
http://download.csdn.net/detail/veron_04/4039695CodePudding user response: