Federico Fanton wrote:
> I'm building a small application where the user can draw on a 
> FloatCanvas, and I need to add the "save to file" feature..
> 
> As far as I understand, the SaveAsImage() method dumps just the current 
> viewport, am I right?

correct.

> Is there a way to export the complete canvas' 
> contents, using a 1:1 scale or (if it makes more sense) specifying the 
> size of the resulting image?

not directly, no. But you could call ZoomToBB() first, and then dump 
that. It would show the user what was happening on screen, though.

It should be possible to just draw to the offscreen buffer, and no have 
the screen updated, but I"d have to poke into the code to see how to do 
that. You may be able to .Hide() the window, then re-draw, then dump the 
bitmap, then Show() again, but that would make the Window disappear and 
re-appear again, which may not be what you want.

If you dig into the code, you could probably find a way to intercept the 
blit to screen after a re-draw (maybe a flag in the EVT_PAINT handler)

This is actually a good reason to support being able to put the same set 
of objects on multiple canvases -- that would make it easy to support 
this. I've always had that in mind, but I don't think you can quite do 
it now.

-Chris










-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to