LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default How to determine JPG size in pixels?

Hi,
You can get the picture height & width like this.

Sub Macro2()
Dim MyPic As IPictureDisp
Set MyPic = LoadPicture("C:\Documents and Settings\jaf\My Documents\My
Pictures\020108-M-8634P-502.jpg")
Debug.Print MyPic.Width, MyPic.Height
End Sub

Or you can assign a height & width like this.

LoadPicture([filename], [widthDesired As Long], [heightDesired As Long],
[flags As LoadPictureConstants = Default]) As IPictureDisp


--

John

johnf202 at hotmail dot com


"dchow" wrote in message
...
Is there a way to determine the size of a JPG file in pixels? I need
to put product pictures on a spreadsheet programmatically. I would
like their size to be as close as possible. So I have to know their
size to determine how much to scale.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine what is causing large size Dave H Excel Discussion (Misc queries) 1 August 7th 09 08:40 PM
How to change column pixels to the standard size? scott Excel Worksheet Functions 0 October 23rd 06 04:33 PM
Size of column in pixels RN Excel Discussion (Misc queries) 0 August 22nd 06 02:19 PM
Determine size of listbox Jasper Excel Discussion (Misc queries) 3 April 18th 06 10:38 PM
some columns 30 characters 155 pixels others 310 pixels why vurden Excel Discussion (Misc queries) 2 April 26th 05 03:30 AM


All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"