|
-
May 6th, 2003, 03:39 AM
#1
Thread Starter
Member
How to get the picture size!
I want to use VB to get a picture size(height and width)?
I don't wanna use the image control or the other control.I only want to use code.thanks advance!
-
May 6th, 2003, 03:56 AM
#2
Assuming you have access to the bitmap handle...
VB Code:
Type Size
cx As Long
cy As Long
End Type
Declare Function GetBitmapDimensionEx Lib "gdi32" Alias "GetBitmapDimensionEx" (ByVal hBitmap As Long, lpDimension As SIZE) As Long
-
May 6th, 2003, 09:38 PM
#3
Thread Starter
Member
Thanks!!!!
but if my picture is .jpg or .gif,can I use it in this format?
-
May 7th, 2003, 03:09 AM
#4
Once a gif or jpg is selected into a device context (i.e. displayed on the screen) it is converted to a bitmap by GDI and you can use the aforementioned API call againts it's handle.
If you want to get the dimensions from the file without displaying it you will need to interogate the file format....I'm afraid I do no t know the format for jpg or gif images, but it'll be documented on the net somewhere.
-
May 7th, 2003, 03:11 AM
#5
Thread Starter
Member
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
|