Recent

Author Topic: Overview of Graphics.  (Read 5994 times)

sean_vn

  • New member
  • *
  • Posts: 8
Overview of Graphics.
« on: July 24, 2014, 08:04:50 am »
What I'm missing is a global overview of how to do graphics in Lazarus/FP.  I had a similar problem with the IUP GUI library in C.  I have no doubt that the IUP library is very good, and there is a lot of information about how about specific items in the library work.  There is no information about how to put the pieces together, nor information about the overall conceptual basis to allow you understand how to fit everything together.  If that information was available I wouldn't be using FP now.  I am finding FP more integrated and easier to use however I am having a similar problem to IUP using graphics.  All I need to do is load, rescale, crop some images and then get the data out.  I don't have a handle on the conceptual structure of TImage and its various subcomponents.  The waters are also muddied by the fact that there are multiple graphics libraries and what exactly is provide with Lazarus/FP and what is external. 
1/ What is available in Lazarus/FP only?
2/ How are those items put together to get functionality?   
« Last Edit: July 24, 2014, 09:32:37 am by marcov »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Overview
« Reply #1 on: July 24, 2014, 08:08:06 am »
Have you seen
http://wiki.lazarus.freepascal.org/Developing_with_Graphics

There's also examples in your Lazarus directory that show use of TImage etc.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

sean_vn

  • New member
  • *
  • Posts: 8
Re: Overview
« Reply #2 on: July 24, 2014, 08:20:57 am »
I'll try drawing out the information on that page and see if I can figure out how things are connected and sequenced.  I'd still prefer to understand the reasoning behind it.  I am sure I will be able to do the things I need to do.  I think the Brazilian authors of IUP maybe found it difficult to explain the conceptual basis of their work in English.  It's a pity because it seems like good library with solid cross platform capabilities.  I just could not get a handle on it.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Overview
« Reply #3 on: July 24, 2014, 08:41:42 am »
What I'm missing is...
Your topic was misleading. Please use more clear topic in the future.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11455
  • FPC developer.
Re: Overview of Graphics.
« Reply #4 on: July 24, 2014, 09:33:20 am »
Moderator note: I agreed with Avra, so I adapted the title. If you have enormous problems with that please send me a pm and I'll change it back

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Overview
« Reply #5 on: July 24, 2014, 09:38:04 am »
I think the Brazilian authors of IUP maybe found it difficult to explain the conceptual basis of their work in English.  It's a pity because it seems like good library with solid cross platform capabilities.  I just could not get a handle on it.
I'm having trouble understanding what a C library has to do with graphics in Lazarus which uses Object Pascal?

Being a graphics newbie myself, I was happy with using the (external) imagemagick using the imagemagick bindings that come with FPC. Imagemagick can handle some image formats (e.g. some TIFF formats like CCIT group 4 fax compressed images) FPC cannot.... and it is a fair bit quicker (the FPC code is primarily coded for correctness and maintainability though speed improvement fixes are made)
See e.g. http://wiki.lazarus.freepascal.org/PascalMagick

There are, as you indicated, many other graphics libraries...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

sean_vn

  • New member
  • *
  • Posts: 8
Re: Overview of Graphics.
« Reply #6 on: July 24, 2014, 03:02:10 pm »
I was comparing the documentation of IUP and FP Graphics.  I was indicating that documentation that only tells you specifically what each individual class or function does is incomplete.  It is useful to know how they inter-operate.  Obviously if I am asking basic questions I am not launching a critique.  I am only looking for a more conversational style walk through of Lazarus/FP graphics.  Nothing more - nothing less.
If this is a hang-out for an in-group then ......     

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Overview of Graphics.
« Reply #7 on: July 24, 2014, 03:11:09 pm »
If you need functionality to scale image, neither FP or Lazarus has that with smooth interpolation. You should look for 3rd party libraries that have studied the subject much longer time, 1 of them being BGRABitmap.

But if quick and dirty is enough, you can just look into TCanvas. There are tutorials for that even for Delphi, and those apply to Lazarus too. Basically CopyRect() does both scale and crop.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Overview of Graphics.
« Reply #8 on: July 24, 2014, 03:13:37 pm »
If this is a hang-out for an in-group then ......     
This is a forum where people willingly help other people. Never ascribe to malice if incomprehension suffices ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

sean_vn

  • New member
  • *
  • Posts: 8
Re: Overview of Graphics.
« Reply #9 on: July 24, 2014, 03:19:26 pm »
Ok, I only need to do a simple data grab from jpg files.  I'll see how it goes in relation to whatever thing.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11455
  • FPC developer.
Re: Overview of Graphics.
« Reply #10 on: July 24, 2014, 04:14:36 pm »
I mostly learned how to work fcl-image using the demoes (imgconv, interpol etc).

But I also only use it as last resort because it is very, very slow. The Lazarus imaging (tlazintf) is a bit faster, but since I mostly use 8-bit imgs I use my own libs.

 

TinyPortal © 2005-2018