Recent

Author Topic: Solid black picture when drawing to canvas  (Read 3446 times)

biggmatt

  • Newbie
  • Posts: 1
Solid black picture when drawing to canvas
« 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:

Code: [Select]
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.

« Last Edit: May 06, 2013, 01:28:09 am by biggmatt »

seoane

  • Newbie
  • Posts: 2
Re: Solid black picture when drawing to canvas
« Reply #1 on: May 06, 2013, 08:26:58 am »
Code: [Select]
   image1.Canvas.Brush.Color:= clWhite;
   image1.Canvas.FillRect(image1.Canvas.ClipRect);