ReadLoadResolutions Example for Visual Basic

Note: Also works with Access 95 and 97.

This example shows how to use the methods and properties for FlashPix files.

Dim TempStr, InfoStr As String       ' For composing message strings
Dim i As Integer ' Loop counter
Dim RasterIO As New LEADRasterIO

' Initialize the display
LEADRasterView1.AutoScroll = False
LEADRasterView1.AutoSetRects = True
LEADRasterView1.PaintSizeMode = PAINTSIZEMODE_FIT
RasterIO.GetFileInfo LEADRasterView1.Raster, "v:\images\image5.fpx", 0, 0
' Update information about the available resolutions.
RasterIO.ReadLoadResolutions "v:\images\image5.fpx"
' Display a message box that shows the available sizes.
InfoStr = "Available dimensions:" + Chr(13)
For i = 0 To RasterIO.LoadResolutionCount - 1
   TempStr = Str(RasterIO.LoadResolutionWidth(i)) + " X " + _
             Str(RasterIO.LoadResolutionWidth(i)) + Chr(13)
   InfoStr = InfoStr + TempStr
Next i
MsgBox InfoStr
' Set the size to load, the smallest size in this case.
RasterIO.SetLoadResolution LEADRasterView1.Raster, _
                           RasterIO.InfoFormat, _
                           RasterIO.LoadResolutionWidth(0), _
                           RasterIO.LoadResolutionHeight(0)
' Get the dimensions that we just set and display them.
RasterIO.GetLoadResolution RasterIO.InfoFormat
InfoStr = "Size that will be loaded:" + Chr(13) + Chr(13)
TempStr = Str(RasterIO.LoadResolutionWidth(0)) + _
          " X " + Str(RasterIO.LoadResolutionWidth(0)) + Chr(13)
InfoStr = InfoStr + TempStr
MsgBox InfoStr
' Load the bitmap, keeping the bits per pixel of the file.
RasterIO.Load LEADRasterView1.Raster, "v:\images\image5.fpx", 0, 0, 1