Windows Metafile and Overlay

  • Thread starter Thread starter sendhil
  • Start date Start date
S

sendhil

hi,
Iam doing some graphics programming with C#. I have to create a
Windows MetaFile from a base64 encoded string. How do i create the
file.

I want to Overlay this Windows MetaFile on a image which is present
in a Picture box. Any ideas to do this?

Thanks
senthil
 
senthil,

You should be able to call the static FromBase64String method on the
Convert class to get an array of bytes representing the Windows MetaFile.
Once you have that, you can pass the array to the constructor of a
MemoryStream instance. Finally, pass that MemoryStream to the constructor
for a Bitmap instance, and you should have a Bitmap that you can use to
overlay on other images, or save to a file, etc, etc.

To produce the overlay, I would get the image in the box, and then just
create a new image, painting the bottom layer, then your metafile over the
image, and then setting the picturebox back to that image.

Hope this helps.
 
Back
Top