* * *

Author Topic: Is there a component for displaying vector graphics in Lazarus?  (Read 14280 times)

vfclists

  • Hero Member
  • *****
  • Posts: 823
    • HowTos Considered Harmful?
Is there a component for display vector graphics in Lazarus?

I am looking for something that will not lose resolution and will show more detail when it is enlarged. Would that be a vector graphic?
Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 800
    • Burdjia
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

vfclists

  • Hero Member
  • *****
  • Posts: 823
    • HowTos Considered Harmful?
Re: Is there a component for displaying vector graphics in Lazarus?
« Reply #2 on: March 26, 2010, 11:20:25 pm »

I did an amount of searching before making the post, and saw both. fpvectorial appears to require FreePascal 2.3.1 and I am on 2.2.4.
AggPas also needs to be compiled and the instructions are more complicated than I would like.

I also asked for a component, something like TImage or TGraphic I can load a file into. This is not an area I am familiar with on both the programming side and the graphics site, and I trying to avoid risking by compilation setup.

http://www.lazarus.freepascal.org/index.php/topic,7212.0.html
http://www.lazarus.freepascal.org/index.php/topic,7165.0.html

Next time, use the Search button.


Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3537
Re: Is there a component for displaying vector graphics in Lazarus?
« Reply #3 on: March 27, 2010, 01:29:04 pm »
I did an amount of searching before making the post, and saw both. fpvectorial appears to require FreePascal 2.3.1 and I am on 2.2.4.

It doesn't require 2.3.1, it just comes preinstalled with it, but it works with older compilers too. Just download the sources and build it with your FPC. The command to download only fpvectorial should be something like:

svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/fpvectorial fpvectorial

vfclists

  • Hero Member
  • *****
  • Posts: 823
    • HowTos Considered Harmful?
Re: Is there a component for displaying vector graphics in Lazarus?
« Reply #4 on: March 29, 2010, 05:42:32 pm »
I am not familiar with the graphics area, but what I am looking for is something which will not become pixellated when it is resized.

With this example code I understand that the image has to be converted to a pdf format before it can be used. The image I have been given is a Photoshop .psd file. Is there a way to convert it into a pdf file first?

Is it a visual component on its own right, or is the code attached to another graphic object which as displayed on the screen or has some kind of Canvas property?

I take it that it has to be redrawn from the stored strings whenever the size is readjusted?

Forgive the numerous questions, I am more of database guy than a graphics guy.

Thanks
« Last Edit: March 29, 2010, 06:13:49 pm by vfclists »
Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: Is there a component for displaying vector graphics in Lazarus?
« Reply #5 on: March 29, 2010, 06:11:29 pm »
It's not very clear what you need.
Photoshop files have nothing to do with vector graphics afaik.
They are like JPEG, PNG with extra info for layers and stuff.
The quality depends on the size/resolution. Converting to PDF does not make sense imho.

vfclists

  • Hero Member
  • *****
  • Posts: 823
    • HowTos Considered Harmful?
Re: Is there a component for displaying vector graphics in Lazarus?
« Reply #6 on: March 29, 2010, 06:26:25 pm »
Someone I did a program for complained that the image size which had to be reduced was too pixellated, so I asked him to get his graphics designer to create a vector image, which resulted in the PSD file being delivered.

After opening it in GIMP I had started to suspect that it isn't truly a vector image. It would be nice to know that it is possible if the graphics are created with a vector graphics program.

It's not very clear what you need.
Photoshop files have nothing to do with vector graphics afaik.
They are like JPEG, PNG with extra info for layers and stuff.
The quality depends on the size/resolution. Converting to PDF does not make sense imho.
Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

Zaher

  • Hero Member
  • *****
  • Posts: 557
    • parmaja.com
Re: Is there a component for displaying vector graphics in Lazarus?
« Reply #7 on: March 29, 2010, 09:01:10 pm »
You can not draw Vector using PhotoShop or GIMP, you must use program that draw and save vectors like inkscape or Adobe Illustrator or Corel Draw,
Now you need to export you image to still vector and with format can Lazarus draw it, Inkscape can export as SVG and AggPas can read it but not all the features of Inkscape, also Inkscape can export PS (PostScript) or WMF, EMF for Windows.

flippinho

  • Newbie
  • Posts: 2
Re: Is there a component for displaying vector graphics in Lazarus?
« Reply #8 on: September 20, 2010, 02:10:17 pm »

Hello,
this comes a bit late, but maybe it is from interest to other people who read this

There is a pretty good binding for the RSVG library for reading SVG Images
 
http://code.google.com/p/luipack/source/browse/trunk/cairo/rsvg/rsvg.pas

There are same helpful classes and examples which go with this binding.

Basically the RSVG-library allows to parse svg images and render and save them with cairo which ships already with Lazarus.

I hope this might help someone,

bye,
flippinho


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus