Board index » delphi » Drawing WMF in a TImage causes crash

Drawing WMF in a TImage causes crash

I am trying to display a windows metafile in a TImage control in
Delphi 5.  The image was created in Illustrator.  It loads without
problem, showing the correct picture.  However when the program runs,
after three or four redraws, or repaints, an error message comes up,
either "Canvas does not allow drawing" or alternatively "The parameter
is incorrect".  Sometimes this leads to a program crash.

I have tried changing all the obvious preperties - eg Autosize,
Stretch, Transparent etc without effect.  Saving the graphic as EMF
rather than WMF does not help either.  Any suggestions would be much
appreciated.

 

Re:Drawing WMF in a TImage causes crash


"John Sved" <js...@mail.usyd.edu.au> skrev i melding
news:9a045b2e.0204020113.35da914e@posting.google.com...

Quote
> I am trying to display a windows metafile in a TImage control in
> Delphi 5.  The image was created in Illustrator.  It loads without
> problem, showing the correct picture.  However when the program runs,
> after three or four redraws, or repaints, an error message comes up,
> either "Canvas does not allow drawing" or alternatively "The parameter
> is incorrect".  Sometimes this leads to a program crash.

> I have tried changing all the obvious preperties - eg Autosize,
> Stretch, Transparent etc without effect.  Saving the graphic as EMF
> rather than WMF does not help either.  Any suggestions would be much
> appreciated.

If you're on  Win95/98/ME:
Sounds like you're running out of GUI resources - check out available
resources with Resource meter in Windows/Accessories/system tools (or
whatever it's called in English version.

The problem may be that you keep allocating new GUI handles without freeing
them.
--
Bj?rge S?ther
bjorge@hahaha_itte.no

Other Threads