Recent

Author Topic: Parse svg, resize and draw in cell grid  (Read 2725 times)

Moneo

  • Newbie
  • Posts: 3
Parse svg, resize and draw in cell grid
« on: May 26, 2017, 10:15:28 pm »
Hello guys. Im need help in work with vectorial graphic SVG. I'm getting svg code from another site and try draw picture in cell of stringgrid use fpvectorial,synapse and stringgrid. Example SVG in attach. For test i try draw 6226.svg in paintbox, but i'm nothing see. When i'm use test.svg worked perfectly. Lazarus 1.6.4, fpvectorial in folder Lazarus. There is one more question: how can I automate such complex svgs in order to draw them in cells and resize them.

Code: Pascal  [Select][+][-]
  1. fpvectorialpkg, fpvectorial,fpvtocanvas
  2. ...
  3.  
  4. var
  5. VECDoc:TvVectorialDocument;
  6. VEC:TvVectorialPage;
  7. begin
  8.  paintbox1.Canvas.Clear;
  9.  VECDoc:=TvVectorialDocument.create;
  10.  try
  11.  
  12.  vecdoc.ReadFromFile('6226.svg');
  13.  
  14.  DrawFPVectorialtoCAnvas(VecDoc.GetPageAsVectorial(0),Paintbox1.canvas,0,Paintbox1.height-100,1,-1);
  15.  finally
  16.  VecDoc.free;
  17.  end;
  18.  
« Last Edit: May 26, 2017, 10:19:31 pm by Moneo »

zamtmn

  • Hero Member
  • *****
  • Posts: 593

 

TinyPortal © 2005-2018