Lazarus
Programming => Packages and Libraries => FPvectorial => Topic started by: biggmatt on May 06, 2013, 01:21:02 am
-
I've been working on a little project with fpvectorial. When i load a svg file and draw it to an image canvas i get a solid black picture.
here is the code:
procedure TMainForm.Button1Click(Sender: TObject);
var
Vec: TvVectorialDocument;
filename:string;
begin
opendialog1.Execute;
Vec := TvVectorialDocument.Create;
try
Vec.ReadFromFile(opendialog1.filename,vfSVG);
image1.picture.Clear;
vec.width:=image1.Width;
vec.height:=image1.Height;
DrawFPVectorialToCanvas(Vec.GetPage(0), image1.canvas);
image1.Invalidate;
finally
Vec.Free;
end;
end;
not sure what i am doing wrong. The svg files i have been loading are simple inkscape files.
-
image1.Canvas.Brush.Color:= clWhite;
image1.Canvas.FillRect(image1.Canvas.ClipRect);