- Home
·
- Graphics
·
- I was working on an application that required the display of pictures. There was no way of predicti
I was working on an application that required the display of pictures. There was no way of predicti
I was working on an application that required the display of pictures. There was no way of predicting or specifying the sizes and
Rate I was working on an application that required the display of pictures. There was no way of predicti
(1(1 Vote))
Private Sub cmdPicture_Click()
Dim str As String, str2 As String
Dim strDrive As String
On Error GoTo Oops
'Get a picture.
cdlPicture.ShowOpen
Image1 = LoadPicture(cdlPicture.FileName)
'Resize the picture.
Call sResizePicture
'If the report was saved anywhere other
'than the default directory (App.Path),
'the whole application will look for
'its support in that other directory.
'The next few lines ensure that we are
'in the correct path.
str2 = App.Path
strDrive = Mid$(App.Path, 1, 1)
str = CurDir
If str <> str2 Then
ChDrive strDrive
ChDir str2
str = CurDir
End If
Exit Sub
Oops:
MsgBox Err.Description, vbExclamation
End Sub
Private Sub sResizePicture()
Dim dblRatio As Double
If Image1.Picture.Height > Image1.Picture.Width Then
dblRatio = Image1.Picture.Width / Image1.Picture.Height
Image1.Height = 2160 'Two inches
Image1.Width = 2160 * dblRatio 'Two inches
ElseIf Image1.Picture.Width > Image1.Picture.Height Then
dblRatio = Image1.Picture.Height / Image1.Picture.Width
Image1.Height = 2160 * dblRatio 'Two inches
Image1.Width = 2160 'Two inches
End If
Image1.Stretch = True
End Sub
I was working on an application that required the display of pictures. There was no way of predicti Comments
No comments yet — be the first to post one!
Post a Comment