LView to Picture

LView to Picture

Post by Sanford Se » Thu, 24 Jun 2004 05:29:31


I have an LView that contains a number of subviews. All subviews draw
with QuickDraw. (They're either LCaptions or custom objects.)

I'd like to capture the drawing of this view into a picture. I figured
I would override Draw() on the top most view and wrap it in
OpenPicture/ClosePicture.

I don't want this view to draw on screen at all, only offscreen. What's
the best way of getting an LView to draw offscreen so I can capture it
as a picture?

Thanks,
Sanford


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.yqcomputer.com/ - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
 
 

LView to Picture

Post by Miro Juris » Thu, 24 Jun 2004 07:07:36

In article < XXXX@XXXXX.COM >,



It's been a while, but there is a PP class that should be helpful
(LOffScreenSomethingRather)

meeroh

--
If this message helped you, consider buying an item
from my wish list: < http://www.yqcomputer.com/ ;

 
 
 

LView to Picture

Post by Sanford Se » Thu, 24 Jun 2004 07:32:37

In article < XXXX@XXXXX.COM >,



LOffscreenView.

I looked into that, but it checks for FocusExposed().

From what I can tell, and I may be wrong, LOffscreenView is designed for
buffering visible objects rather than making offscreen drawing easier.
And my objects will never be visible.

Best,
Sanford


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.yqcomputer.com/ - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
 
 

LView to Picture

Post by Gregory Do » Thu, 24 Jun 2004 10:38:04

In article < XXXX@XXXXX.COM >,



I think LGWorld (in UGWorld.cp) will help.

Create your view hierarchy, with a top-level LView subclass that has no
superview. Make a DrawInPicture() function for that LView subclass to
create a LGWorld, open a picture and draw the subviews. In pseudo-code
it would look something like:


MyView::DrawInPicture()
{
/* mGWorld should be an instance variable */
mGWorld = new LGWorld( /* creation parameters here */ );

mGWorld >BeginDrawing();

PicHandle thePicture = OpenPicture( /* frame */ );

TArrayIterator<LPane*> iterator(mSubPanes);
LPane *theSub;
while (iterator.Next(theSub)) {
theSub->Draw(mUpdateRgn);
}

ClosePicture();

mGWorld->EndDrawing();
}


You will also need to override EstablishPort() to set the current port
to the mGWorld. Look at how LOffscreenView does this.

I haven't actually tried this, so I don't know if it will work. But I
think looking at LWorld and LOffscreenView will give you a good idea of
how to write your LView subclass that draws into a picture.

-- Greg