Another good example is the TPrintPreview component (available from the
Delphi Super page - with source!). It stores all actions in a metafile and
I'm pretty sure it uses streaming in there somewhere.


From: "Phil Scadden" <[EMAIL PROTECTED]> AT tawa on 16/03/99 10:04 ZE12

To:   Multiple recipients of list delphi <[EMAIL PROTECTED]> AT
cc:    (bcc: Phillip Middlemiss/NZ Forest Research Institute/NZ)
Subject:  Re: [DUG]:  text on canvas

>When I resize the image, i.e. zoom in or zoom out, the text looks like
>CRAP !<FontFamily><param>Times New Roman</param><bigger>

<FontFamily><param>Arial</param><smaller>>I had a look at how QR does this,
basically it saves the image canvas
>to a metafile in memory then loads it back in, but when I tried this, I
kept >getting an invalid metafile when I either saved to stream or saved to
file.<FontFamily><param>Times New Roman</param><bigger>

When you write to image you are writing into a bitmap. Zooming is done by

Stretchblt so with text stored as pixels, you get UGLY. TT fonts will work

you zoom by: StretchBlt the non-text part of your bitmap, scale your font
and redraw the text again on top of the bitmap. This is ugly and hard to

fonts so they "register" properly. The metafile approach really is the way

go - it keeps all vectors as vectors. I have not mastered how to store
metafiles in a streams, (seems to be basic lack of API support for this)
but never had any problem with write/read from file. Got some code for us
to look at? Mine is pretty well based on theTeechart code which does same

Phil Scadden, Institute of Geological and Nuclear Sciences
PO Box 30368, Lower Hutt, New Zealand
Ph +64 4 5704821, fax +64 4 5704603
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]

    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]

Reply via email to