{"id":418,"date":"2012-02-26T19:03:23","date_gmt":"2012-02-26T19:03:23","guid":{"rendered":"http:\/\/devnot.wordpress.com\/?p=418"},"modified":"2012-02-26T19:03:23","modified_gmt":"2012-02-26T19:03:23","slug":"playing-a-metafile","status":"publish","type":"post","link":"https:\/\/thomas-jansen.eu\/?p=418","title":{"rendered":"Playing a metafile"},"content":{"rendered":"<p>To show a metafile<\/p>\n<pre>\nmetaFile = new Metafile(path);\ne.Graphics.DrawImage(metaFile, clientRect);    \nmetaFile.Dispose(); \nmetaFile = null;\n<\/pre>\n<p>Although this code shows the metafile, you may notice strange scaling problems. The metafile is being drawn ignoring the aspect ratio!<\/p>\n<p>You can get the original size using the following code<\/p>\n<pre>\nMetafileHeader header = metaFile.GetMetafileHeader();\nRect metaRect = header.Bounds;\n<\/pre>\n<p>Use the metaRect to adjust the clientRect to get the same aspect ratio and the scaling will be fine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To show a metafile metaFile = new Metafile(path); e.Graphics.DrawImage(metaFile, clientRect); metaFile.Dispose(); metaFile = null; Although this code shows the metafile, you may notice strange scaling problems. The metafile is being drawn ignoring the aspect ratio! You can get the original size using the following code MetafileHeader header = metaFile.GetMetafileHeader(); Rect metaRect = header.Bounds; Use the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-418","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=418"}],"version-history":[{"count":0,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/418\/revisions"}],"wp:attachment":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}