VB 6.0 IMAGE VIEWER APPLICATION [ CODE ] - iJayaprakash

VB 6.0 IMAGE VIEWER APPLICATION [ CODE ]


Place a drive list box, directory list box, file list box, four label boxes, a line (usethe line tool) and a command button on the form. We also want to add an imagebox, but make it look like it's in some kind of frame. Build this display area inthese steps: draw a 'large shape', draw another shape within this first shape thatis the size of the image display area, and lastly, draw an image box right on top ofthis last shape. Since the two shapes and image box are in the same displaylayer, the image box is on top of the second shape which is on top of the first Shape, providing the desired effect of a kind of picture frame



 

Private Sub cmdexit_Click()
End
End Sub

Private Sub cmdshow_Click()
Dim imagename As String
If Right(fileimage.Path, 1) = "\" Then
imagename = fileimage.Path + fileimage.FileName
Else
imagename = fileimage.Path + "\" + fileimage.FileName
End If
lblimage.Caption = imagename
Image1.Picture = LoadPicture(imagename)
End Sub

Private Sub dirimage_Change()
fileimage.Path = dirimage.Path

End Sub

Private Sub drvimage_Change()
dirimage.Path = drvimage.Drive


End Sub



This code forms the file name (ImageName) by concatenating the directory path
with the file name. It then displays the complete name and loads the picture into
the image box.


No comments:

Post a Comment

Translate