windows – SVG exported to EMF loses precision, but exported as PNG looks fine – Super User

I am Windows desktop programmer that needs to convert certain SVG into EMF in order to use it for programming. My graphics design skills are at beginner level, but I have managed to convert SVG file into EMF successfully using Inkscape. However, the result is not looking as the original one, it is less 'precise' so to say. If I export the SVG as PNG the result is the same as the original file. Unfortunately I need vector format that Windows recognizes and that is only EMF ( I am using pure WinAPI and C++, hence this limitation... ). To see exactly what I mean, link to original SVG, and EMF and PNG that I made is here. Just click on the Download:test.rar above the 5 yellow stars ( see picture below ). The problem seems to be the dimensions of the EMF file ( it should be 90 x 120 ) as the picture is crystal clear when I resize my application to bigger dimensions. To further help you in your efforts to solve my problem, here is a small application that will display EMF in a window. Just keep the EMF in the same place the application is, and name the EMF as test.emf. As 4. look similar to 1. (i.e. the desired result), my conclusion is that the conversion to EMF format is perfectly fine, but your code scales the graphic with a simple, probably pixel based algorithm. So IMHO you need to implement e.g. a bilinear interpolation routine. When viewed with Photoshop, the EMF does not have an added frame, so this seems to be a problem with the viewer. Not able to download your viewer for some obscure reason, I have used the Free WMF Viewer to view your EMF image, The EMF file looks perfect - it scales up and down perfectly as should a vector graphics image. But that viewer also shows a black frame around the image. I have also viewed your EMF using an old wmf/emf viewer that I have once written, which also doesn't show the black frame. I remark that in my own viewer I have used the bounding box only to determine the aspect ratio of the image (height vs. width), so as to display it correctly, meaning not squashed or stretched. My conclusion is that both viewers display the bounding box as a frame. This is incorrect, since its purpose is to give information about the image's recommended viewing rectangle, rather than be displayed. Your process of generating the EMF seems therefore to be correct. Source.

Яндекс.Метрика Рейтинг Free Web Counter
page counter
Last Modified: November 26, 2014 @ 12:00 am