Re: Sizing an Image

From: Bryan Reich [MSFT] (brreich_at_online.microsoft.com)
Date: 03/04/04


Date: Thu, 4 Mar 2004 15:02:23 -0800

This is a copy of a reply to a post in microsoft.public.access.modulesdaovba
that I answered (subject: When reading through files in a dir - can I get
size of jpeg's?). Hopefully it may provide a possible solution for you:

***** BEGIN COPY ****

Ok, this is not an ideal solution, but it might work for you:

    Dim f As String
    f = "myPicture.jpg"

    Dim im As Object

    Form_Form2.Image1.Picture = f
    MsgBox Form_Form2.Image1.ImageWidth / 15
    MsgBox Form_Form2.Image1.ImageHeight / 15

I've embedded an invisible picture control on this form and I use it to load
the image. I then ask it to give me the details on the image. The "/ 15"
converts the number it returns into screen pixels.
Hope that might get you closer. Post back if you still have questions.

--
Bryan Reich
Microsoft Office
-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jesper F" <anonymous@discussions.microsoft.com> wrote in message
news:8b6601c3e9aa$79e1d020$a501280a@phx.gbl...
> I know how to read through a directory and place the file
> names in a table.
> But is it possible to read through a directory with image
> files (jpg) and obtain the size/dimensions in pixels of
> each image?
>
> Thanks for any help.
***** END COPY ****
-- 
Bryan Reich
Microsoft Office
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Edward Harford" <eharford@apsconsortium.co.uk> wrote in message
news:OKJFlWdAEHA.2036@TK2MSFTNGP12.phx.gbl...
> I want to test the orientation and sizing of a jpg file from disk and the
> create Image in a Word Document using Word Document object:
> docWord.Shapes.AddPicture filename  etc.
> How can I test Height and Width of that file?
> With thanks in advance
> EHarford
>
>


Relevant Pages

  • Re: Unable to open JPG files in IE
    ... >>Can someone please explain to me why I can't view any jpg file within ... > Try the steps in the two article below to see if they help resolve the ... rights. ... Use of included script samples are subject to the ...
    (microsoft.public.internet.explorer.ieak)
  • Re: IsInRole does not seem to work
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... > administrator, like Sales, Personnel etc.. ... >> Use of included script samples are subject to the terms specified at ...
    (microsoft.public.dotnet.security)
  • Re: Modify default replication wait period in ADAM
    ... This posting is provided "AS IS" with no warranties, and confers no rights ... > Use of included script samples are subject to the terms specified at ... >> I am trying to find out how to modify the default amount of time an ADAM ... > instance waits to push a directory change to a member of a replica set. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Using ldifde & csvde
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... > How can I get the Windows 2000 versions and will they work with a Windows ... >> Use of included script samples are subject to the terms specified at ...
    (microsoft.public.windows.server.active_directory)
  • Re: Quick way to change display name from first last to last, first
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... > Please do not send email to this address, post a reply to this newsgroup. ... > Use of included script samples are subject to the terms specified at ... > "Brian Brilhart" wrote in message ...
    (microsoft.public.exchange.admin)

Loading