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.

Phil.
[EMAIL PROTECTED]



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

To:   Multiple recipients of list delphi <[EMAIL PROTECTED]> AT
      tawa@kauripo@CCMAIL
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,
 and
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
IF

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
scale

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

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
approach.


<nofill>
----------------------------------------------------------
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]
                  Website: http://www.delphi.org.nz







---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to