http://bugs.winehq.org/show_bug.cgi?id=2096
------- Additional Comments From saulius.krasuckas@elst.vtu.lt 2006-09-08 01:43 ------- In a case someone will be interested in analysis of StartUML Code. By looking at StarUML repository via WebCVS you can see this:
* PDiagramViewAuto.ExportDiagramAsMetafile(FileName) procedure [1] calls * StarUMLApplication.SaveDiagramImageToMetafile(ADiagramView, FileName, Enhanced) [2], which basically does * AMetafile := MetafileFromDiagram(ADiagramView, False, Enhanced) and calls * AMetafile.SaveToFile(FileName) .
* MetafileFromDiagram() uses [3] quite a few TMetafileCanvas methods. And most interesting place IMHO is this:
12131 AMetafile := TMetafile.Create; 12132 AMetafile.Enhanced := Enhanced; ... ... 12145 AMetafileCanvas := TMetafileCanvas.Create(AMetafile, AMetafile.Handle); 12146 ACanvas := PCanvas.Create(AMetafileCanvas); 12147 try 12148 ACanvas.ZoomFactor := ZoomFactor(100, 100); 12149 ACanvas.Font.Height := -13; 12150 ACanvas.Font.Name := 'Verdana'; 12151 ACanvas.OriginX := - ARect.Left; 12152 ACanvas.OriginY := - ARect.Top; ... ... 12159 end else ADiagramView.Draw(ACanvas); 12160 Result := AMetafile;
Though I still would need a help from Delphi wizard to convert this to plain WinAPI ;-) to make a proper testcase.
[1]http://staruml.cvs.sourceforge.net/staruml/staruml/staruml/src/CoreAuto.pas?... [2]http://staruml.cvs.sourceforge.net/staruml/staruml/staruml/src/StarUMLApp.pa... [3]http://staruml.cvs.sourceforge.net/staruml/staruml/staruml/src/UMLViews.pas?...