metafile

Vector graphics clipboard format for Qt.

I want my Qt application to be able to save simple vector graphics to clipboard in a compatible way. On windows I want to be able to paste the graphics into Microsoft Word or Powerpoint. On Linux I want to be compatible with the Open Office. Which format would you recommend? Can Qt generate EMF in an easy way? Is SVG an option? Update...

What is the .NET equivalent of CreateEnhMetaFile and PlayEnhMetaFile?

I'm porting some C++ code to VB.NET which creates a print job consisting of several pages. Every page has a template of graphical objects (text, lines, curves, etc) which stays the same on each page, and overlaid on top of that is the different data for each page. The template is created at the start of the print job as an in-memory met...

Where can I find documentation and/or examples of working with TMetafile and TMetafileCanvas?

As I'm working to add custom printing to my application, I've settled on using TMetafile to create the pages, then using it to preview &/or print, but I'm finding the documentation lacking. Are there any good resources for learning the ins and outs of working with TMetafile and TMetafileCanvas? ...

Reliable .wmf/wmf to Pixel based image conversion

Good afternoon, I am having a little trouble with .net's internal (System.Drawing) based MetaFile / Image handling of .wmf files that containt transparent areas. Basically whenever I do a MetaFile.LoadFile(...) and take that to save it as a tiff/png etc, some areas of that source files are missing. I can't really pin it down, but it -se...

GDI+ Image Conversion From Metafile to JPEG/GIF Results in Black Background

So i am converting a metafile (EMF to be exact) to a jpeg or gif (doesn't matter as long as it's compatible with browsers) and when I do the conversion, all of the transparent pixels turn black. I have no idea how to do this in GDI+ but here is the method I am using to save the file: Dim Img As System.Drawing.Imaging.Metafile = New Sys...

Convert HTML in CWebBrowser2 element into VECTOR metafile

I have tested a number of solutions to capture the HTML content of a CWebBrowser2 element into a vector metafile. I can get either part of the web page as vector emf, or I can get all of the webpage as a raster bitblt wrapped in an emf wrapper. What I want is All of the webpage as vector with only original bitmaps, flash, etc represent...

Specifying DPI of a GDI Device Context

I have an application that generates metafiles (EMFs). It uses the reference device (aka the screen) to render these metafiles, so the DPI of the metafile changes depending on what machine the code is running on. Let's say my code is intending to create a metafile that is 8.5 in x 11 in. Using my development workstation as a reference, ...

C# Enumerate Metafile

I want to "playback" the rendering of a Metafile class (.WMF Image). I have seen a few examples using the EnumerateMetafile method, however they do not show how I would get the lines or points I would need to draw. The purpose is to draw the WMF to a special format using only points, lines and curves. Any help is greatly appreciated....

How do I parse a polyline metafile record out of a byte array?

I need a little help in defining the following Windows GDI type in C#. I have the data in the form of a byte[] in C#, and I need to somehow marshal or cast it as the following in C#. I suppose I need to define the proper struct? This is the type: NAME META_POLYLINE NEAREST API CALL #include <windows.h> BOOL32 Polyline ( HDC32 hd...

How do I parse a CREATEPENINDIRECT metafile record out of a byte array?

I need a little help in defining the following Windows GDI type in C#. I have the data in the form of a byte[] in C#, and I need to somehow marshal or cast it as the following in C#. Please see my other question, as I got the answer to the Polyline. This is the type: NAME META_CREATEPENINDIRECT NEAREST API CALL #include <windows.h> ...

How do I parse a PolyPolygon16 metafile record out of a byte[] c#

I need a little help in defining the following Windows GDI type in C#. I have the data in the form of a byte[] in C#, and I need to somehow marshal or cast it as the following in C#. This is the type: http://java.freehep.org/vectorgraphics/apidocs/org/freehep/graphicsio/emf/gdi/PolyPolygon16.html http://msdn.microsoft.com/en-us/libra...

VB.net Saving an MetaFile / EMF as a bitmap ( .tiff)

Currently I have a third party control that generates a Metafile. I can save the .wmf file to disk with out issue. The problem is how do I render the Metafile as a Tiff file. Currently I have the following code to get my metafile and save it. Dim mf As Metafile = page.GetImage(TXTextControl.Page.PageContent.All) ...

DPI for EMF files

Do EMF files have a DPI that can be set? I have an application that allows saving an image in multiple formats (including EMF). I allow the user to specify the resolution/DPI for the image(s). However, I cannot find a way to do this for a MetaFile in C#. Is this possible or does EMF not have a DPI since it is a vector graphics format? ...

Deserializing Metafile

I have an application that works with Enhanced Metafiles. I am able to create them, save them to disk as .emf and load them again no problem. I do this by using the gdi32.dll methods and the DLLImport attribute. However, to enable Version Tolerant Serialization I want to save the metafile in an object along with other data. This esse...

How to paste metafile from Microsoft Word at expected size

I'm having an issue in a WPF application using the RichTextBox where content being pasted in from Microsoft Word is mangled. To work around the issue, I found that Word includes a metafile on the clipboard, and I can get the metafile from the clipboard using interop (WPF wouldn't properly import the metafile either). My problem, though...

Scaling problem with metafile playback

Hi, I am creating a metafile using VC6 and playing it back. The code to create the metafile just draws a few lines of thickness 1: CMetaFileDC memDC; CRect rect (0, 0, 100, 100); memDC.CreateEnhanced( CBrush m_brush(RGB(255,255,255)); CPen m_pen(PS_SOLID, 1, COLORREF(RGB(0, 255, 0))); memDC.SelectObject( memDC.SelectObject( m...

Drawing transparent TMetaFile on TCanvas in Delphi

I would like to draw a transparent TMetaFile on a Canvas, used for print watermark. The problem is AlphaBlend function won't recognize TMetaFile.Handle as source as it expects canvas handle. I created a 32bit bitmap with transparency but drawing on it will force white background thus on Canvas you can see an alpha blended rectangle. Ho...