[RESOLVED] VBA question: open JPEG, get image size-VBForums

# Thread: [RESOLVED] VBA question: open JPEG, get image size

1. ## [RESOLVED] VBA question: open JPEG, get image size

In VBA in ArcMap, I need to open a JPEG file and get its image size. I've added a reference to System.Drawing, so now I can at least Dim a variable as a Bitmap, but when I try to type in the Bitmap constructor specifying the file path, basically VBA doesn't recognize the syntax. What am I missing?

Thanks,
danl

2. ## Re: VBA question: open JPEG, get image size

Welcome the the Forums

Never used ArcMap before, so i can't really test this, but if its VBA then it shouldn't be a problem. I think...

VB Code:
`Const ScaleChange As Double = (635 / 24)Dim Pic As IPictureDisp    Set Pic = LoadPicture("D:\pix.gif")        Imgwidth = Round(Pic.Width / ScaleChange)    ImgHeight = Round(Pic.Height / ScaleChange)        MsgBox "Picture demensions: " & Imgwidth & " x " & ImgHeight`

By the way, there is also a forum for VBA

3. ## Re: VBA question: open JPEG, get image size

System.Drawing is a .NET Framework reference. Are you doing this as some VB.NET automation of ArcMap?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured