Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / July 2005



Tip: Looking for answers? Try searching our database.

jpeg width/height?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
D & J G - 30 Jul 2005 15:24 GMT
Hi
Is there any way to 'look' at a jpeg file with VB6 and return its width and
height in pixels?  I want to be able to fix the right-hand edge of different
sized jpegs to the right-hand edge of a form and picures are usually placed
by distance from top and left.
TIA
Don
Rick Rothstein [MVP - Visual Basic] - 30 Jul 2005 16:18 GMT
> Is there any way to 'look' at a jpeg file with VB6 and return
> its width and height in pixels?  I want to be able to fix the
> right-hand edge of different sized jpegs to the right-hand
> edge of a form and picures are usually placed by distance
> from top and left.

You could load the picture into a StdPicture and convert that object's
width (and height if needed) from its native Himetric measurement system
to the form's ScaleMode using the ScaleX (and ScaleY) methods. Here is
an example that places a picture file that you read from the hard disk
into the bottom right corner of the form...

 Dim Pict As StdPicture
 Set Pict = LoadPicture("D:\Directory\Path\To\Your.jpg")
 Me.PaintPicture Pict, Me.ScaleWidth - Me.ScaleX(Pict.Width, _
                       vbHimetric, Me.ScaleMode), _
                       Me.ScaleHeight - Me.ScaleY(Pict.Height, _
                       vbHimetric, Me.ScaleMode)

Rick
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.