vb6 program like windows picture and fax viewer..help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samvb
    New Member
    • Oct 2006
    • 228

    #1

    vb6 program like windows picture and fax viewer..help

    happy new year to you all,

    i have a program that views pictures. The pictures could have different sizes. Some are bigger than the screen size, some are smaller than that. I want to display the entire content of the picture in image control or picture control like windows pic and fax viewer does:

    i tried this but it failed to work:

    Code:
    Option Explicit
    Private Sub Form_Load()
    Dim scrw As Double
    Dim scrh As Double
    Dim imgw As Double
    Dim imgh As Double
    
    scrw = Screen.Width / Screen.TwipsPerPixelX
    scrh = Screen.Height / Screen.TwipsPerPixelY
    
    imgw = Image1.Width / 15
    imgh = Image1.Height / 15
    
    MsgBox Image1.Width
    
    If imgw > scrw Then
    Image1.Width = Screen.Width
    
    Me.Move 0, 0
    Else
    Me.Width = Image1.Width
    End If
    
    If imgh > scrh Then
    Image1.Height = Screen.Height
    
    Me.Move 0, 0
    Else
    Me.Height = Image1.Height
    End If
    
    Me.Width = Image1.Width
    Me.Height = Image1.Height
    Me.Top = 0
    Me.Left = 0
    End Sub
    Private Sub Image1_Click()
    Unload Me
    End Sub
    NB: picture is added to image1 from database application.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    your code never refers to the source of the image !

    Comment

    • samvb
      New Member
      • Oct 2006
      • 228

      #3
      what do you mean? please clarify a lil bit.

      Comment

      Working...