Metafiles and DrawImage problem

jeronimobertran

New member
Joined
Sep 8, 2004
Messages
1
I am having a problem using DrawImage to scale metafiles. Here is what
I am doing:

Metafile mapImage = new Metafile("C:\\image.wmf");

If I draw the entire metafile it draws correctly:

g.DrawImage(mapImage, 0, 0);

If I try to scale the metafile into the graphic, it does get scaled
correctly but tho origin is moved so what gets drawn in position 0,0 is
not position 0,0 in the metafile even though both rectangles have 0,0
values.

g.DrawImage(bitmapMap, new Rectangle(0, 0, bitmapDest.Width,
bitmapDest.Height), new Rectangle(0, 0, mapImage.Width,
mapImage.Height), GraphicsUnit.Pixel);

In fact the above statement SHOULD display the entire metafile but it
only displays a portion on the lower right corener of the metafile.

Also, if instead of using a metafile, I use a Bitmap, then I dont have
this problem (i.e Bitmap mapImage = new Bitmap("C:\\image.bmp"))

Any help would be appreciated.

Jeronimo
 
Back
Top