Blt Method Example (Regular Bitmap)

Blt Method Example (Regular Bitmap)

This example uses a Command Button to display the Bitmap image data from memory onto a Picture Box control on the form. To try the example, place a Command Button and a Picture Box on your form, set the Picture Box's AutoRedraw property to True, and paste the code into your form's module. Then run the example.


Private Sub cmdShowImage_Click()
  Dim strFileName As String
  Dim BMU As VWBitmapUtils.BitmapUtils
  
  'Initialize the BitmapUtils object.
  Set BMU = New VWBitmapUtils.BitmapUtils
  
  strFileName = "C:\WINDOWS\Coffee Bean.bmp"
  
  'Load the Bitmap into memory.
  Call BMU.LoadByteData(strFileName)
  
  'Blt the image from memory to the Picture Box.
  Call BMU.Blt(Picture1.hDC)
End Sub