I have some questions about image randering.
When I save a Trichview output as two image files of wmf and bmp,
it is different that the size(width*height) and the space between letters of wmf from those of bmp.
How can I save the same size(width*height) of wmf and bmp?
Because I have to provide a transparent finish, I need the same size of wmf such as bmp.
I 'd appreaciate your quick response. thx.
used source and output image :
http://devsik.cafe24.com/wmf_bmp_.zip
TRichview to WMF or BMP Output Image Size.
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sorry, I do not know how to define TMetafile size so that it is exactly equal to the bitmap size.
In my test, your example generates the same image for metafile and bitmap, they can be compared by placing Image on top of Image2.
However, with a minor modification (instead of assigning Image.Picture.Graphic := wmf, saving wmf to a file and loading in Image.Picture.Metafile), the result becomes completely wrong.
This situation may be saved by assigning MMWidth and MMHeight:
This assignment must be done after freeing Canvas (but before freeing wmf; yes, Canvas should be freed before)
In my test, your example generates the same image for metafile and bitmap, they can be compared by placing Image on top of Image2.
However, with a minor modification (instead of assigning Image.Picture.Graphic := wmf, saving wmf to a file and loading in Image.Picture.Metafile), the result becomes completely wrong.
This situation may be saved by assigning MMWidth and MMHeight:
Code: Select all
wmf.MMWidth := Round((Width/Screen.PixelsPerInch)*2540);
wmf.MMHeight := Round((Height/Screen.PixelsPerInch)*2540);