Q: How can I select an area from the device independent bitmap?
A: You can select an area from a DIB with the CropDIB method. This method is available in the BiDIB.ocx. The CropDIB works monochrome 2, 4, 8, 16, 24 and 32 bit per pixels images. You must specify the device independent bitmap, and the coordinates of the area, and then the method retrieves the selected area as a DIB. You can obtain the DIB by loading from files, databases etc.
Code example:
Private Sub MyMethod(ByVal FileName As String, ByVal left As Long, ByVal top As Long, ByVal right As long, ByVal bottom As Long)
Dim Dib As Long
Dim Area As Long
…
Dib = BiDib.LoadDibFromFile(FileName)
If Dib > 0 Then
Area = BiDib.CropDIB(Dib, left, top, right, bottom)
If Area > 0 Then
…
End If
End If
…
End Sub