FitTo Example VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"
    ImgEdit1.FitTo BEST_FIT
    ImgEdit1.Display
             
    Load frmInfo
    
    'Display the dimensions of the image page.
    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight
    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth
    
   'Display the X and Y resolution of the image page.
    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX
    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY
        
    'Display Image Scale Height
    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight
    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth
    
    frmInfo.Show 1
End Sub