Jump to navigation

Poupou's Corner of the Web

Looking for perfect security? Try a wireless brick.
Otherwise you may find some unperfect stuff here...

Weblog

I submit Mr. T

to Jackson's SWF contest.


"Blogged to death" picture but still the first EMF worth showing

under the category "small is beautiful" ;-)

using System; using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms; public class MainForm : Form { private Metafile metafile; private float ratio; public MainForm (Metafile mf, float r) { metafile = mf; ratio = r; Size = new Size (340, 450); Paint += new PaintEventHandler (PaintMetafile); } void PaintMetafile (object sender, PaintEventArgs e) { e.Graphics.ScaleTransform (ratio, ratio); e.Graphics.DrawImage (metafile, 10, 10, metafile.Width, metafile.Height); } [STAThread] static int Main (string[] args) { if (args.Length == 0) { Console.WriteLine ("mono metaview.exe metafile.[wmf|emf]"); return 1; } Metafile metafile = new Metafile (args [0]); Console.WriteLine ("Width {0}, Height {1}", metafile.Width, metafile.Height); float ratio = (args.Length > 1) ? Single.Parse (args [1]) : (320.0f / metafile.Width); Application.Run (new MainForm (metafile, ratio)); return 0; } }

of course this needs the, soon to be commited, libgdiplus update.


3/8/2007 08:45:58 | Comments | Permalink

The views expressed on this website/weblog are mine alone and do not necessarily reflect the views of my employer.