Tiling Bitmaps into Controls, Forms and MDI Form backgroundsĬreating a new GDI Bitmap from a VB Picture or DCĬreate a VB Picture from a GDI Picture HandleĬopy the entire contents of a PictureBox to the clipboardĬreate a mask image (all black for the transparent colour otherwise white) from a bitmap RotateBitmap - Rotate a 256-color bitmap by any angle GetScreenSnapshot - Capture a window or the entire screen ' IMAGE_BITMAP, thumbwid, thumbhgt, LR_MONOCHROME)īitBlt Picture2.hdc, 0, 0, thumbwid, thumbhgt, hDcNew, 0, 0, vbSrcCopy 'hBmpNew = CopyImage(LoadPicture(Text1), _ '//or Directly Load resized image from the file IMAGE_BITMAP, thumbwid, thumbhgt, LR_MONOCHROME) ![]() '// CopyImage returns handle to resized bitmap '//Resize image to exact same size of destination picturebox Picture1.Height = ScaleY()ĭim hDcNew, hBmpNew As Long, hBmpOld As Long Private Declare Function BitBlt Lib "gdi32" ( _īyVal hDestDC As Long, ByVal x As Long, ByVal y As Long, _īyVal nWidth As Long, ByVal nHeight As Long, _īyVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, _ Private Declare Function DeleteDC Lib "gdi32" ( _ Private Declare Function DeleteObject Lib "gdi32" ( _ Private Declare Function SelectObject Lib "gdi32" ( _īyVal hdc As Long, ByVal hObject As Long) As Long Private Declare Function CreateCompatibleDC Lib "gdi32" ( _ Private Declare Function CopyImage Lib "user32" ( _ Place two picturebox controls and two command buttons CopyImage can create a new resized monochrome bitmap using single API call. ![]() In some situation you can find CopyImage API very useful.
0 Comments
Leave a Reply. |