Tag Archives: metafile

Extract text from a metafile in C#

The example Enumerate the records in a metafile in C# shows how to list the records in a metafile. This example lists the records, looks for those that represent DrawString commands, and extracts their text. The following code shows the … Continue reading

Posted in algorithms, graphics | Tagged , , , , , , , , , , , | 2 Comments

Enumerate the records in a metafile in C#

The example Display a Windows metafile (wmf) in C# shows how to draw a metafile. This example shows how to enumerate the records in the metafile that represent its drawing commands and draw only some of them. When you enter … Continue reading

Posted in algorithms, graphics | Tagged , , , , , , , , , | Leave a comment

Convert a metafile into a PNG file in C#

A metafile (WMF file) contains drawing commands that tell a program how to produce an image. This is very useful and allows you to resize the image without producing ugly anti-aliasing effects, but sometimes you may want a raster image … Continue reading

Posted in drawing, files, graphics, image processing | Tagged , , , , , , , , , , , , | 2 Comments

Make a metafile in C#

The example Display a Windows metafile (wmf) in C# explains how to display a metafile and why metafiles can produce better results than raster images such as those stored in bmp, jpg, or png formats. This example shows how a … Continue reading

Posted in drawing, files, graphics, image processing | Tagged , , , , , , , , , , , | Leave a comment

Display a Windows metafile (wmf) in C#

A Windows metafile (wmf) is an image file that contains instructions for drawing shapes. In contrast, bitmap, PNG, JPG, and other raster image files indicate exactly what colors individual pixels should have. Because a Windows metafile contains drawing instructions instead … Continue reading

Posted in drawing, files, graphics, image processing | Tagged , , , , , , , , , , , , , , , , , | Leave a comment

Enumerate metafile records in C#

This example shows how you can enumerate metafile records. You can then decide which ones to draw. (Although I’m not sure in general how you make that decision.) When the program starts, it uses the following code to load the … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , , | Leave a comment

Read and draw a metafile in C#

This example shows how to read a metafile and draw its contents. This is really easy in C#. When the program starts, it executes the following code. private void Form1_Load(object sender, EventArgs e) { Metafile mf1 = (Metafile)Metafile.FromFile(“test.emf”); picMetafile1.Image = … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , | 1 Comment

Make and use a metafile in C#

This example shows how to draw and use a metafile. A metafile is a drawing that doesn’t just contain the pixels in an image. Instead it contains a record of the commands used to produce a drawing so you can … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , | 3 Comments