Jump to content
omnibrain

Looking for small (vector) drawing component/library

Recommended Posts

I'm looking for a small component/library to just draw some vectors, perhaps add some predefinded shapes and load some bitmaps, save everything and perhaps export to bmp/png, whatever.

I want to be able to "paint" by hand and "paint programatically".

I found littleearth/draw-objects: draw-objects (github.com) (Update to TDrawObject Components (angusj.com))

In a previous search I found something similar, but I can't seem to find it anymore.

Perhaps someone has an idea?

I don't think I need a fullblown CAD solution...

 

Share this post


Link to post
Posted (edited)
On 7/2/2022 at 2:49 PM, SwiftExpat said:

You might take a look at TMS, https://www.tmssoftware.com/site/tmsfncblox.asp

 

Thanks, I did not know that. 

That looks like it's a bit much... I also don't understand what "FNC" means. Are they "native" VCL or something different? It may or may not come with a whole host of baggage...

 

In the meantime I found the other component again: DELPHI AREA » Simple Graph Component

 

I really need only some basic stuff I can salvage into my own application. 

 

Edit: I tried both and neither has the option to insert (background) bitmaps in the demo. I guess that would be easy enough to implement, but if I remember correctly I had another one that offered this option out of the box. But I can't find it anymore...

Edit2: Might have been Simple Graph after all. There in the Demo I can set a bitmap as background in one shape and use that as a background for everything else.

Edited by omnibrain

Share this post


Link to post
7 hours ago, omnibrain said:

I also don't understand what "FNC" means

Literally it is Framework Neutral Components.  When you install FNC components, they are available for VCL and FMX. Both frameworks are covered under the same license.

It is all Delphi code, so not really any baggage.  In the source code it is a series of IfDef that adjusts for VCL or FMX.

Likely the FNC version is a port of the vcl only component https://www.tmssoftware.com/site/diagram.asp

FNC tends to be lighter on features, cheaper on the license.  VCL and FNC are both actively developed at TMS.

The idea is that you learn the component properties, which are the same across VCL, FMX, lazarus and Web, and the component works the same regardless of the framework.

 

 

  • Thanks 1

Share this post


Link to post
22 minutes ago, corneliusdavid said:

This might be overkill but Skia4Delphi comes to mind as doing all that and more (I think).

Thanks, I know Skia and toyed with the demo programs for a bit. Skia sure is capable, but using Skia would mean that I have to implement all the "diagram" stuff like click to place, connecting lines, etc.

Share this post


Link to post
On 7/4/2022 at 11:24 PM, Anders Melander said:

 

Thanks.
Of course I found Graphics32 and Image32, but they seem to be a bit much. And it looks like I need to implement the basic stuff I need (the drawing) by myself.
At least I did not find the "old demo of the GR32_Objects unit" you mentioned.

Share this post


Link to post

Its still a little unclear to me if you are on VCL or FMX.
Graphics32 is fine of course for VCL, I would not call it too "fat", but its basically a raster graphics library.
You can have a look at Image32 too, which works well under VCL/FMX, as well as with some support for SVG structures.

 

If you look after the very "thin" FMX solution, then maybe TPath is also worth a look.

This is able to define SVG-like PathData draw paths, by simple text codes.
If you combine some paths separated by "z" then also quite complex shapes can be drawn.

 

Share this post


Link to post
22 hours ago, Rollo62 said:

its basically a raster graphics library.

Unless you're working on a 1970s vector monitor all vectors eventually ends up as raster graphics...

image.thumb.png.e3439b292714626961d92607cfa68d0c.png

 

Graphics32 has a pretty extensive (and fast) vector layer. Image32 is the same in that regard; A vector layer on top of a raster layer.

 

I would have thought that GR32_Objects would fit the bill but it seems like the couple of hundred lines of code required to implement a complete object based vector drawing application is too large an effort.

  • Like 1

Share this post


Link to post
Posted (edited)
16 hours ago, Anders Melander said:

I would have thought that GR32_Objects would fit the bill but it seems like the couple of hundred lines of code required to implement a complete object based vector drawing application is too large an effort.

If you would be so kind to point me into the direction where I can find GR32_Objects I could evaluate it. But it is not part of the Graphics32 repository. From my google search it looks like it was an add on by AngusJ, who concentrates on Image32 now. But I fail to find a source.

But a couple of hundred lines are indeed too large an effort if it means reinventing the wheel. That's why I asked first for a finished solution. I can still invent the wheel if it's not invented yet, or I need square wheels for whatever reason.
The TMS component linked by SwiftExpat is an option, but it looks like that the Delphi Area Simple Graph Component (despite being abandoned by its creator) is sufficient for my needs.

Edited by omnibrain

Share this post


Link to post
13 hours ago, omnibrain said:

If you would be so kind to point me into the direction where I can find GR32_Objects I could evaluate it.

https://torry.net/pages.php?id=112#939914

 

It probably doesn't work with the current version of Graphics32, because the GR32 polygon classes has been redesigned since it was written, but it will probably work with the version of Graphics32 available on the same page at torry.net

 

14 hours ago, omnibrain said:

But it is not part of the Graphics32 repository. From my google search it looks like it was an add on by AngusJ, who concentrates on Image32 now.

That's correct. It's abandonware but that's not been a problem for me in the one project were it's used since it's a fairly small library and the functionality is limited. AFAIR it took me about an hours to integrate it into the application where it's used but of course I already knew Graphics32 so that helped a lot.

Let me know if you want to see the source of the unit using it.

 

14 hours ago, omnibrain said:

But a couple of hundred lines are indeed too large an effort if it means reinventing the wheel.

To each their own - but I think I could have typed 200 lines of code in the time it has taken me to locate the library and write this message 🙂

  • Thanks 1

Share this post


Link to post
2 minutes ago, Anders Melander said:

I could have typed 200 lines of code in the time it has taken me

I would have spent the next week debugging those 200 lines and reading documentation, and probably still not have been happy with the result.

 

Still good explanation on your part and you at least make it seem easy enough to try. 

  • Like 1

Share this post


Link to post
2 hours ago, Anders Melander said:

It's abandonware

Indeed it is. Although the zip files are still there (DrawObjects and DrawObjectsDemo), I've removed the published links because this code is obsolete (and untouched for more than 10yrs) since Graphics32 has evolved and I've also moved on to other things 😁

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×