Dynamic replacement of metafiles records not possible when playing back with GDI
- From: "deemok@xxxxxxxxxxxxxx" <deemok@xxxxxxxxxxxxxx>
- Date: 1 Jun 2006 04:59:16 -0700
Hi!
I'm working on a document export facility which is supposed to be
backed up by EMF files.
The idea is to optimize an EMF so that no bitmaps are stored internally
(for now, say, in the StretchDIBits records), but rather a reference to
the image is kept in a private comment block and a dummy StretchDIBits
is stored in the metafile that has a kind of a banner to give an idea
of an image that might've been stored here (for instance, a bitmapped
name of the external file).
Later, these files comprise part of the document history thus a
requirement to keep them as small and well-behaved as possible. (The
magnitude of information stored in the document can easily blow an
ordinary EMF to be several 10s of MBs in size - which is hopefully
remedied with such a links-only solution which would still keep EMFs
conform)
The problem I'm facing is when I'm playing back such EMFs and replace
the dummy StretchDIBits with the actuall data (that I collect elsewhere
based on the links stored in the commented block), and that data is
naturally bigger than the dummy data that originally comes from the
metafile, GDI refuses to play back such a record. I figured the reason
for that is the GDI validates the sizes of the provided actual image
buffer and the size of the meta file (here, size of the metafile is
either physical metafile size or size of the metafile bits set with
SetEnhMetaFileBits())
Now, I can probably consider that a security measure which I would love
to turn off as we're not set to "misuse" the metafiles.
If there's another reason, I would love to hear a rationale.
To Feng Yuan : thanks for your great book; perhaps you would have the
answer for me?
Thanks all for your help in advance,
dmitri.
.
- Follow-Ups:
- Re: Dynamic replacement of metafiles records not possible when playing back with GDI
- From: deemok@xxxxxxxxxxxxxx
- Re: Dynamic replacement of metafiles records not possible when playing back with GDI
- Prev by Date: Re: Having trouble with pens and brushes
- Next by Date: Re: Desktop pixel manipulation
- Previous by thread: Re: Having trouble with pens and brushes
- Next by thread: Re: Dynamic replacement of metafiles records not possible when playing back with GDI
- Index(es):
Relevant Pages
|