fpvectorial: Add wmf to sample project fpvectorialconverter, some layout improvements.

git-svn-id: trunk@52843 -
This commit is contained in:
wp 2016-08-20 17:07:07 +00:00
parent 2292ee9bdb
commit 22a65dfeb7
3 changed files with 75 additions and 41 deletions

View File

@ -1,96 +1,137 @@
object formVectorialConverter: TformVectorialConverter object formVectorialConverter: TformVectorialConverter
Left = 216 Left = 216
Height = 456 Height = 481
Top = 192 Top = 192
Width = 240 Width = 297
AutoSize = True
BorderStyle = bsSingle BorderStyle = bsSingle
Caption = 'FP Vectorial Converter' Caption = 'FP Vectorial Converter'
ClientHeight = 456 ClientHeight = 481
ClientWidth = 240 ClientWidth = 297
LCLVersion = '1.5' LCLVersion = '1.7'
object Label1: TLabel object Label1: TLabel
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
Left = 8 Left = 8
Height = 15 Height = 15
Top = 128 Top = 133
Width = 133 Width = 133
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Location of the Input file:' Caption = 'Location of the Input file:'
ParentColor = False ParentColor = False
end end
object Label2: TLabel object Label2: TLabel
Left = 6 Left = 8
Height = 120 Height = 120
Top = 0 Top = 5
Width = 236 Width = 281
AutoSize = False Align = alTop
Caption = 'This converter application use the fpvectorial library to convert between various different vectorial graphics formats. The type is detected from the extension and the supported types are: PDF (*.pdf), SVG (*.svg) and Corel Draw file (*.cdr).' BorderSpacing.Left = 8
BorderSpacing.Top = 5
BorderSpacing.Right = 8
Caption = 'This converter application uses the fpvectorial library to convert between various different vectorial graphics formats. The type is detected from the extension and the supported types are: '#13#10'- PDF (*.pdf)'#13#10'- SVG (*.svg)'#13#10'- Corel Draw file (*.cdr)'#13#10'- Windows Metafile (*.wmf).'
Font.Height = -12 Font.Height = -12
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
WordWrap = True WordWrap = True
end end
object editInput: TFileNameEdit object editInput: TFileNameEdit
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
Left = 8 Left = 8
Height = 27 Height = 23
Top = 144 Top = 152
Width = 192 Width = 281
DialogOptions = [] DialogOptions = []
FilterIndex = 0 FilterIndex = 0
HideDirectories = False HideDirectories = False
ButtonWidth = 23 ButtonWidth = 23
NumGlyphs = 1 NumGlyphs = 1
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 4
BorderSpacing.Right = 4
MaxLength = 0 MaxLength = 0
TabOrder = 0 TabOrder = 0
end end
object Label3: TLabel object Label3: TLabel
AnchorSideTop.Control = editInput
AnchorSideTop.Side = asrBottom
Left = 8 Left = 8
Height = 15 Height = 15
Top = 168 Top = 183
Width = 143 Width = 143
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Full path of the Output file:' Caption = 'Full path of the Output file:'
ParentColor = False ParentColor = False
end end
object editOutput: TFileNameEdit object editOutput: TFileNameEdit
AnchorSideTop.Control = Label3
AnchorSideTop.Side = asrBottom
Left = 8 Left = 8
Height = 27 Height = 23
Top = 184 Top = 202
Width = 192 Width = 281
DialogOptions = [] DialogOptions = []
FilterIndex = 0 FilterIndex = 0
HideDirectories = False HideDirectories = False
ButtonWidth = 23 ButtonWidth = 23
NumGlyphs = 1 NumGlyphs = 1
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 4
BorderSpacing.Right = 4
MaxLength = 0 MaxLength = 0
TabOrder = 1 TabOrder = 1
end end
object buttonConvert: TButton object buttonConvert: TButton
Left = 87 AnchorSideTop.Control = buttonVisualize
Left = 80
Height = 25 Height = 25
Top = 208 Top = 233
Width = 67 Width = 67
Caption = 'Convert' Caption = 'Convert'
OnClick = buttonConvertClick OnClick = buttonConvertClick
TabOrder = 2 TabOrder = 2
end end
object buttonQuit: TButton object buttonQuit: TButton
Left = 176 AnchorSideTop.Control = buttonVisualize
Left = 160
Height = 25 Height = 25
Top = 208 Top = 233
Width = 59 Width = 59
Caption = 'Quit' Caption = 'Quit'
OnClick = buttonQuitClick OnClick = buttonQuitClick
TabOrder = 3 TabOrder = 3
end end
object imagePreview: TImage object imagePreview: TImage
AnchorSideTop.Control = buttonVisualize
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 8 Left = 8
Height = 210 Height = 208
Top = 240 Top = 266
Width = 224 Width = 281
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Constraints.MinHeight = 200
end end
object buttonVisualize: TButton object buttonVisualize: TButton
AnchorSideTop.Control = editOutput
AnchorSideTop.Side = asrBottom
Left = 8 Left = 8
Height = 25 Height = 25
Top = 208 Top = 233
Width = 59 Width = 62
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Caption = 'Visualize' Caption = 'Visualize'
OnClick = buttonVisualizeClick OnClick = buttonVisualizeClick
TabOrder = 4 TabOrder = 4

View File

@ -38,7 +38,7 @@ var
implementation implementation
uses uses
fpvectorial, cdrvectorialreader, svgvectorialwriter, //pdfvectorialreader, fpvectorial, cdrvectorialreader, svgvectorialwriter, wmfvectorialreader, //pdfvectorialreader,
fpvtocanvas; fpvtocanvas;
{$R *.lfm} {$R *.lfm}
@ -54,12 +54,12 @@ procedure TformVectorialConverter.buttonVisualizeClick(Sender: TObject);
var var
Vec: TvVectorialDocument; Vec: TvVectorialDocument;
begin begin
// First check the in input // First check the input
if not CheckInput() then Exit; if not CheckInput() then Exit;
Vec := TvVectorialDocument.Create; Vec := TvVectorialDocument.Create;
try try
Vec.ReadFromFile(editInput.FileName, vfPDF); Vec.ReadFromFile(editInput.FileName); //, vfPDF);
imagePreview.Canvas.Brush.Color := clWhite; imagePreview.Canvas.Brush.Color := clWhite;
imagePreview.Canvas.FillRect(0, 0, imagePreview.Width, imagePreview.Height); imagePreview.Canvas.FillRect(0, 0, imagePreview.Width, imagePreview.Height);
DrawFPVectorialToCanvas(Vec.GetPageAsVectorial(0), imagePreview.Canvas); DrawFPVectorialToCanvas(Vec.GetPageAsVectorial(0), imagePreview.Canvas);
@ -70,7 +70,7 @@ end;
function TformVectorialConverter.CheckInput(): Boolean; function TformVectorialConverter.CheckInput(): Boolean;
begin begin
// todo... Result := true; // todo...
end; end;
procedure TformVectorialConverter.buttonConvertClick(Sender: TObject); procedure TformVectorialConverter.buttonConvertClick(Sender: TObject);
@ -78,7 +78,7 @@ var
Vec: TvVectorialDocument; Vec: TvVectorialDocument;
lFormat: TvVectorialFormat; lFormat: TvVectorialFormat;
begin begin
// First check the in input // First check the input
if not CheckInput() then Exit; if not CheckInput() then Exit;
// Now convert // Now convert

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="9"/> <Version Value="9"/>
@ -42,14 +42,13 @@
<Unit0> <Unit0>
<Filename Value="fpvectorialconverter.lpr"/> <Filename Value="fpvectorialconverter.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="fpvectorialconverter"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="fpvc_mainform.pas"/> <Filename Value="fpvc_mainform.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="formVectorialConverter"/> <ComponentName Value="formVectorialConverter"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="fpvc_mainform"/>
</Unit1> </Unit1>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
@ -70,12 +69,6 @@
</Win32> </Win32>
</Options> </Options>
</Linking> </Linking>
<Other>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions> </CompilerOptions>
<Debugging> <Debugging>
<Exceptions Count="4"> <Exceptions Count="4">