Difference between revisions of "fpvectorial"
From Free Pascal wiki
Jump to navigationJump to searchSekelsenmat (talk | contribs) |
Sekelsenmat (talk | contribs) (→Usage) |
||
Line 24: | Line 24: | ||
==Usage== | ==Usage== | ||
− | * | + | * Loads a PDF, converts it to G-Code and writes the G-Code to a TStrings descendent |
+ | |||
+ | <delphi> | ||
+ | uses | ||
+ | fpvectorial, pdfvectorialreader, avisocncgcodewriter; | ||
+ | |||
+ | var | ||
+ | Vec: TvVectorialDocument; | ||
+ | begin | ||
+ | if dialogoAbrir.Execute() then | ||
+ | begin | ||
+ | Vec := TvVectorialDocument.Create; | ||
+ | try | ||
+ | Vec.ReadFromFile(dialogoAbrir.FileName, vfPDF); | ||
+ | Vec.WriteToStrings(synCodigo.Lines, vfGCodeAvisoCNCPrototipoV5); | ||
+ | finally | ||
+ | Vec.Free; | ||
+ | end; | ||
+ | end; | ||
+ | end; | ||
+ | </delphi> | ||
Go to back [[Package_List|Packages List]] | Go to back [[Package_List|Packages List]] |
Revision as of 15:11, 8 August 2009
Introduction
FPVectorial offers support to read, modify and write vectorial images.
It's counterpart library is fp-image, which works with raster images. FPVectorial comes with a unit which allows to draw a vectorial image to a TFPCustomCanvas, but no routines are provided to convert raster images to vectorial images.
Current file list
FPVectorial is located in Free Pascal 2.3.1+ in the directory fpc/packages/fpvectorial/src
The central unit is fpvectorial.
Readers and writers for various image formats
- pdfvectorialreader - Read support for PDF files, supports compression, only reads the first page
- avisocncgcodereader - Read support for the G-Code from the Aviso CNC machine
- avisocncgcodewriter - Write support for the G-Code from the Aviso CNC machine
Other units
- fpvtocanvas - Converts a vectorial document to a TFPCustomCanvas descendent (like TCanvas). Essentially converts the vectorial image to a raster image
- pdfvrlexico, pdfvrsemantico, pdfvrsintatico, avisozlib - Other units from the PDF reader, don't use directly
Usage
- Loads a PDF, converts it to G-Code and writes the G-Code to a TStrings descendent
<delphi> uses
fpvectorial, pdfvectorialreader, avisocncgcodewriter;
var
Vec: TvVectorialDocument;
begin
if dialogoAbrir.Execute() then begin Vec := TvVectorialDocument.Create; try Vec.ReadFromFile(dialogoAbrir.FileName, vfPDF); Vec.WriteToStrings(synCodigo.Lines, vfGCodeAvisoCNCPrototipoV5); finally Vec.Free; end; end;
end; </delphi>
Go to back Packages List