PCDRes example for Visual Basic

This example checks for a high resolution image and loads it if possible.

myfile = "v:\images\img0024.pcd" 'No PCD sample image is included with LEADTOOLS
Lead1.GetFileInfo myfile, 0, 0
If Lead1.InfoPCDRes(PCDRES_4BASE) = True Then
    Lead1.PCDRes = PCDRES_4BASE
    msg = "Loading 1024 x 1536 resolution"
Else
    Lead1.PCDRes = PCDRES_BASE
    msg = "Loading 512 x 768 resolution"
End If
MsgBox msg

MousePointer = 11 ' hourglass

'Turn on the automatic display rectangles and the scroll bars.
Lead1.AutoSetRects = True
Lead1.AutoScroll = True

'Load the file.
Lead1.Load myfile, 0, 0, 1

Lead1.ForceRepaint

MousePointer = 0 ' default