Re: Converting a (big) canvas to an image
- From: Arndt Roger Schneider <roger.schneider@xxxxxxxxx>
- Date: Sat, 30 Aug 2008 15:01:35 +0200
Helmut Giese schrieb:
Hello out there,
as far as I can tell from various articles on the wiki printing a big
(potentially larger than screen size) canvas will be difficult (on
Windows).
However, if it were possible to convert the whole canvas to an image,
I think it would be a much easier task to later break this image up
into smaller (page size) parts and then print those. Or maybe the user
is already content to have an image - who knows.
I don't think there exists a package which does this (at least I
haven't found anything), but I wouldn't mind having a go at it and
fight with the Windows API to achieve what I'm after.
Question: What were the (conceptual) steps to transform the complete
content of a canvas - currently visible or not - into an image (on
Windows)?
Side note: If it makes this task easier I could restrict the canvas to
not contain embedded widgets.
Side note 2: If this restriction is not enough I could further
restrict the canvas to not contain embedded images, either.
Any hints, links or ideas will be greatly appreciated.
Best regards
Helmut Giese
You need a bitmap, in order to
generate an image of it!
So an image can only contain those
parts visible in your canvas.
what you could do is: scrolling through
the scrollregion and then make a series
of screenshots --either with what you found
in the wiki, or tkpath 0.3 surface --maybe
surface works offscreen, but I doubt it.
Printing on Windows:
The problem is the size of a resulting
bitmap.
If you have a source image 100x100
and send it to a printer, then the bitmap
must be expanded to the resolution of
your printer aka 1200000x1200000 (1200dpi
printer). --you won't have enough memory
for doing this, and its slow.
Consequently: You can't use Bitblt!
Use: stretchDIBBitblt instead for printing.
-roger
.
- References:
- Converting a (big) canvas to an image
- From: Helmut Giese
- Converting a (big) canvas to an image
- Prev by Date: Converting a (big) canvas to an image
- Next by Date: activeTcl 8.5.4 built in packages
- Previous by thread: Converting a (big) canvas to an image
- Next by thread: activeTcl 8.5.4 built in packages
- Index(es):
Relevant Pages
|