Link to home
Start Free TrialLog in
Avatar of PhillipBurton
PhillipBurton

asked on

Rotate jpg/tif

I have an Image box in a form, whose image is populated in VBA as follows:

Image26.Picture = LoadPicture("c:\hi.jpg")

How can I get it to load rotated 90 degrees?

I am aware that http://support.microsoft.com/default.aspx?scid=KB;en-us;q186260 allows a bitmap to be rotated 90 degrees, but it doesn't work for jpgs or tifs.

Many thanks.

Avatar of imarshad
imarshad
Flag of Pakistan image

Why do you want to use an "Image Box" and why not a "Picture Box"..... The image box donot have hDC which severely limits the use of API to rotate the image.......

Avatar of PhillipBurton
PhillipBurton

ASKER

If I could use a PictureBox, who would I do the rotation?
ASKER CERTIFIED SOLUTION
Avatar of Burbble
Burbble
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Burbble's solution seems quick, if one eplaces pic1hDC%, pic1hDC% with pic1hDC&, pic1hDC&.

Whilst  imarshad's solution looks good, it seems to take ages with a fairly big graphic.

Thanks to everyone who helped.
Glad you got it working, thanks for the points.

-Burbble