|
-
Jun 9th, 2000, 07:42 AM
#1
Thread Starter
_______
I use common dialog to go to any folder and select a
gif or jpg file to be moved into my image folder for later view via a pic display. Is there a way to get the properties of the picture file before I move it...I am concerned with the width and hight of the picture and it
will be only jpg or gif.
ie..
if (selected picture).width > my size _
or (selected picture).height > my size then
msgbox...sorry picture is too large for program
exit
endif
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 10th, 2000, 10:19 PM
#2
You can load it up in a hidden ImageBox and then check the Width and Height properties for it, then unload it and tell wheather it's too big or not.
-
Jun 10th, 2000, 10:30 PM
#3
Addicted Member
this works for gif's, don't know about jpg though, I can't remember who wrote this it wasn't me, full credit to who ever it was.
Function LoadImageData(FName As String) As String
Dim Temp As String
On Error GoTo FErrorLabel
Open FName For Binary Access Read As #2
Temp = String(FileLen(FName), Chr(0))
Get #2, , Temp
Close #2
LoadImageData = Temp
On Error GoTo 0
Exit Function
FErrorLabel:
LoadImageData = ""
MsgBox "File not found: " & FName
On Error GoTo 0
End Function
to actually call it and find out the info
Private Sub Command1_Click()
tempinfo = LoadImageData("C:\yourgifhere.gif")
MsgBox "Image Width: " & Asc(Right(Left(tempinfo, 7), 1))
MsgBox "Image Height: " & Asc(Right(Left(tempinfo, 9), 1))
End Sub
but you are better to use Megatron's suggestion its a much easier way of doing it.
-
Jun 10th, 2000, 10:32 PM
#4
Thread Starter
_______
OK
sounds like a plan...thanks both
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|