IonicWind Software

IWBasic => General Questions => Topic started by: wiskie on September 01, 2008, 05:52:17 PM

Title: Loadimage
Post by: wiskie on September 01, 2008, 05:52:17 PM
pic = loadimage ("image01.jpg", @IMGSCALABLE)
SHOWIMAGE(d1,pic,@IMGSCALABLE,2,2 )
:) ???
Is there a way to get the original image width and height
so that it can be scaled to the size I want

Also I have been battling to get an ole routine to work
Any help would be appreciated


Title: Re: Loadimage
Post by: sapero on September 01, 2008, 06:27:16 PM
Hi wiskie, try this:$include "ocidl.inc"

pointer pic
pic = loadimage("image01.jpg", @IMGSCALABLE)

int w, h
GetScalableImageSize(pic, w, h)

MessageBox 0, using("#x#", w, h), ""
DeleteImage(pic, @IMGSCALABLE)


' note: pic must be valid, loaded as @IMGSCALABLE
sub GetScalableImageSize(pointer pic, int w byref, int h byref)
IPicture p
OLE_HANDLE hBitmap
BITMAP bmp

p = pic+0
p->get_Handle(&hBitmap)
GetObject(hBitmap, len(bmp), &bmp)
w = bmp.bmWidth
h = bmp.bmHeight
return
endsub
Title: Re: Loadimage
Post by: wiskie on September 02, 2008, 03:59:09 AM
 8)
Thanks sapero
[img] "Thanks.jpg" [/img]
Worked out just fine.. after I got all the includes and libs in place.
Great Stuff !!