[futurebasic] Re: [FB] Image to Clipboard Rv

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2011 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Tue, 29 Mar 2011 11:03:49 +1300
Warren Lanford wrote:

> I need to be able to obtain the picture's boundsrect once I've retrieved an image from the clipboard in order to move it around and work with it.

> After considerable searching this is all I could find that was new to me.
> fn QDGetPictureBounds(picH,GWCRect)
> Of course it didn't work.  It's either because it's an old command or I'm doing something wrong.

You are doing something wrong.

'------------------
// PutClipboardPictH() and GetClipboardPictH() as posted previously
dim as Rect      r, r2, r3
dim as PicHandle h, h2

window 1
SetRect( @r, 10, 10, 90, 90 )
print r.left r.top r.right r.bottom

h = fn OpenPicture( @r )
PaintRect( r )
ClosePicture()
fn QDGetPictureBounds( h, @r2 )
print r2.left r2.top r2.right r2.bottom

fn PutClipboardPictH( (Handle)h )
KillPicture( h )
h2 = fn GetClipboardPictH
fn QDGetPictureBounds( h2, @r3 )
print r3.left r3.top r3.right r3.bottom

KillPicture( h2 )
HandleEvents
'------------------