i use picture box to load different picture each time.the picture size is not same. so, when i load a picture that the size is smaller or bigger than the picture box.
the data use to represent each pixel in picture is false because the scale that is fixed to the picture box size(code below), not the actual picture size which i loaded.
how to write the code to represent the actual picture size which i loaded????
Code:Private Sub Form_Load() ' Me.Font.Bold = True With Picture1 .AutoRedraw = True .ScaleLeft = 101.46667 .ScaleWidth = 99.7 - 101.46667 .ScaleTop = 2.85667 .ScaleHeight = 4.0166694 - 2.85667 End With End Sub Private Sub picture1_mousemove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label1.Caption = X Label2.Caption = Y End Sub




Reply With Quote