LoadBitmap Method Example

LoadBitmap Method Example

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 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.
  BMU.LoadByteData(strFileName)

  'Blt the image from memory to the Picture Box.
  BMU.Blt(Picture1.hDC)
End Sub