May 04, 2024, 06:01:57 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Loadimage

Started by wiskie, September 01, 2008, 05:52:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wiskie

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



sapero

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

wiskie

 8)
Thanks sapero
[img] "Thanks.jpg" [/img]
Worked out just fine.. after I got all the includes and libs in place.
Great Stuff !!