AggPas and BGRABitmap comparison lazarus / 39-Graphics ---------------------------------------------------------------------- Graeme · 2016-07-06 15:19 Continuing from the original thread, but under a new topic name. Quote from: circular on July 06, 2016, 01:14:00 amQuoteAnother nice feature I like using in AggPas is hooking up multiple rendering pipelines (eg: TAgg2D as well) to the same render buffer, but each instance only has access to a certain region of the rendering buffer.For multithreading? Exactly, yes. But there are other uses too. Quote from: circular on July 06, 2016, 01:43:53 amFor example 6, here is how to do it with BGRABitmap. And suddenly BGRABitmap usage also looks quite complex [or no different to AggPas]. At least it does for me - speaking as somebody that is not familiar with BGRABitmap. Other useful AGG features are pixel buffer formats - AggPas already contains quite a few formats as standard though. It is quite easy to add new buffer layouts. eg: One could add a FPImage pixel buffer format where color channels are Word size instead of the more common Byte size. From the name, I'm assuming BGRABitmap only supports pixel buffers in the BGRA32 format? ---------------------------------------------------------------------- circular · 2016-07-07 00:05 Quote from: Graeme on July 06, 2016, 05:19:50 pmAnd suddenly BGRABitmap usage also looks quite complex [or no different to AggPas]. At least it does for me - speaking as somebody that is not familiar with BGRABitmap. Indeed, in this case it is similar. That's what I am saying, that you want to do something usual with BGRABitmap, it is simple, and if you want to do something a bit more special, you can do it, it becomes a bit more complicated, but that's possible. Now if something is used often, people can request that it would be integrated, that there would be a function that would do exactly that. That's also why I am inviting you to actually write those classes that make life simpler so that people can use AggPas without too much thinking. Otherwise it is a steep learning curve and it is out of reach for many people. QuoteOther useful AGG features are pixel buffer formats - AggPas already contains quite a few formats as standard though. It is quite easy to add new buffer layouts. eg: One could add a FPImage pixel buffer format where color channels are Word size instead of the more common Byte size. From the name, I'm assuming BGRABitmap only supports pixel buffers in the BGRA32 format?Yes. I am considering adding other pixel formats, but for now that's indeed BGRA or RGBA 32-bit. That's the bit I agreed with you as we started this conversation. For me there are two advantages to AggPas, as I said from the start: - it is faster on average for software rendering - it has different pixel formats for the rendering buffers There are two drawback: - it is complicated, not readable, using a peculiar object model - you need to add ten or twenty units to the uses clause for the simplest program and lots of initialization code It is more or less equal to BGRABitmap regarding: - quality of drawing - doing specific things (with AggPas using the pipeline and with BGRABitmap using scanners, paths, arrays of points) There are things that are not better but some ready-to-use features are in one library and not the other. AggPas has some 2D transformation features for path and images that are not available in BGRABitmap and better SVG support BGRABitmap has Phong shading, Foyd-Steinberg dithering and color number reduction, lots of ready-to-use filters, OpenGL 2D and 3D acceleration, lots of raster image formats including layered images ---------------------------------------------------------------------- Graeme · 2016-07-11 16:13 Quote from: circular on July 07, 2016, 02:05:08 am- you need to add ten or twenty units to the uses clause for the simplest program and lots of initialization code Then use the Agg2D object located in the agg_2D.pas unit for pure non- gui applications. Or use the TAgg2D class located in the Agg2D.pas (for use with fpGUI - Lazarus includes the equivalent for LCL). http://www.crossgl.com/aggpas/documentation/index.html Then you only need to include one unit and use a much simple API. You do sacrifice some of the more advanced AggPas features, but most seem happy with what it offers. On a side note: I'm also busy implementing LCD anti-aliased sub-pixel text rendering for AggPas. Developers will then be able to choose between the 256 grayscale or color anti-aliasing of text. ---------------------------------------------------------------------- circular · 2016-07-12 11:40 There are indeed lots of functions in Agg2D. However I am thinking about not sacrificing anything. QuoteI'm also busy implementing LCD anti-aliased sub-pixel text rendering for AggPas. Developers will then be able to choose between the 256 grayscale or color anti-aliasing of text. I am curious, can you expand a bit on that? ---------------------------------------------------------------------- Akira1364 · 2016-07-17 00:12 In my opinion: AggPas (and indeed Maxim Shemanarev's Anti-Grain Geometry C++ library which it was ported from) was never intended to be a standalone graphics library, but moreso a raw foundation on which one might build a graphics library. For day-to-day immediate use, it just doesn't have anywhere close to the overall capabilities and ease-of-use provided by BGRABitmap. ---------------------------------------------------------------------- Graeme · 2016-07-17 00:33 Quote from: Akira1364 on July 17, 2016, 02:12:49 amit just doesn't have anywhere close to the overall capabilities and ease-of-use provided by BGRABitmap. Capabilities? Have you actually ran all the demos included with AggPas? They are very impressive, fast and clearly show that AGG (and AggPas) is up to the task for some serious 2D graphics. No wonder that Haiku, OpenStreetMaps, MatPlot, Foxit Reader (PDF viewer) all use the AGG library. Don't confuse "different" with not capable. As with anything programming related - it takes time to truly learn a framework you haven't used before. ---------------------------------------------------------------------- Akira1364 · 2016-07-17 01:33 Quote from: Graeme on July 17, 2016, 02:33:30 amQuote from: Akira1364 on July 17, 2016, 02:12:49 amit just doesn't have anywhere close to the overall capabilities and ease-of-use provided by BGRABitmap. Capabilities? Have you actually ran all the demos included with AggPas? They are very impressive, fast and clearly show that AGG (and AggPas) is up to the task for some serious 2D graphics. No wonder that Haiku, OpenStreetMaps, MatPlot, Foxit Reader (PDF viewer) all use the AGG library. Don't confuse "different" with not capable. As with anything programming related - it takes time to truly learn a framework you haven't used before. For starters, all of the applications you listed are certainly written in C++ and use the original C++ version of the library. Secondly, yes, I have ran the demos, and experimented with AggPas rather extensively. Nothing it can do isn't something that can be done 90% of the time in less lines of code with BGRABitmap (or even with Graphics32, which I personally think is itself rather outdated.) It also does not provide any kind of library-native generic image class equivalent to a TBGRABitmap (which can load, contain, and modify pretty much any image file type you'd ever want to use with zero effort), which to me makes it immediately far less useful. Finally, it has no 3D capabilities at all, whereas BGRABitmap has an (increasingly) robust set of them. Honestly though I was not trying to pick a fight here, just stating my opinion! I think fpGUI is a very impressive project regardless of what graphics library you're using. ---------------------------------------------------------------------- fxc · 2016-07-17 06:20 hi circular and thanks for the great BGRABitmap indeed aggpas is faster than BGRABitmap , didn't you find where is the bottleneck ? , i my self tried but the source is extremely large, i lost  . on the other hand BGRABitmap is easier and elegant than aggpas . if i were you (i wish i had your knowledge ), i'd spend much time on optimization rather than adding new functionality . ---------------------------------------------------------------------- circular · 2016-07-17 08:51 Hello fxc Indeed I am wondering where is the bottleneck and I did try to look at the source code but I also got lost. I may try again, as AggPas is a source of inspiration regarding its speed. I have been optimizing here and there, for example the fast blur and the polygon filling functions. Maybe I will go through AggPas examples and compare the speed of each of them and try to find what elements are slower. @graeme: The point of Akira, as was my point as well, is not that you cannot do things with AggPas, rather than you can do things with very few lines of code. And that's what I have been aiming for in my work with BGRABitmap. ---------------------------------------------------------------------- Graeme · 2016-07-17 17:46 Quote from: Akira1364 on July 17, 2016, 03:33:57 amFor starters, all of the applications you listed are certainly written in C++ and use the original C++ version of the library. Yes, and AggPas is an exact copy of AGG, but just in Object Pascal. If you compare any unit from AGG with the equivalent unit of AggPas, the code will match exactly, and even the unit names are identical. The same goes for the demos. QuoteIt also does not provide any kind of library-native generic image class equivalent to a TBGRABitmap (which can load, contain, and modify pretty much any image file type you'd ever want to use with zero effort) You clearly don't understand AGG/AggPas then. It renders to any image buffer, which can even be something as simple as a byte array. It also supports many more pixel formats to what BGRABitmap can - in fact, BGRABitmap only supports BGRA (8-bit color channels) formats. Simply tell AGG/AggPas the image buffer it can use (most classes that represent an image gives you access to the raw image data) - LCL does, VCL does and fpGUI does. The TAgg2D class makes that a single method call - TAgg2D.Attach (bitmap, flip_y): boolean; QuoteFinally, it has no 3D capabilities at all, Well, considering that AGG/AggPas is a 2D graphics library by design, that makes perfect sense then. ;-) It never had a design goal to be a 3D graphics library. If you want a 3D graphics library, look elsewhere like at OpenGL or equivalents with hardware acceleration. Regards,   G. ---------------------------------------------------------------------- Graeme · 2016-07-17 17:52 Quote from: circular on July 17, 2016, 10:51:53 am...you can do things with very few lines of code. And that's what I have been aiming for in my work with BGRABitmap. And AGG's goal was not to create a "black box" effect. On that ground the designs are vastly different. BGRABitmap follows the classic design of supplying a Canvas like class that does everything (or almost everything). AGG's goal is to give you independent features that you can literally string together (customizable pipeline rendering engine) creating any unique combination you need for a specific task. Maybe the original AGG website can explain that design goal better than I do. ---------------------------------------------------------------------- circular · 2016-07-17 18:08 I think you are putting it well Graeme about how AGG is structured. By the way, if we do another graphic contest, you are invited to join. You may want to show us what you can do with AGG. ---------------------------------------------------------------------- circular · 2016-07-17 18:19 About the examples we talked about and distorting the pen, with version 9.1 you can do it easily with BGRABitmap: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses BGRATransform, BGRAPath; procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);var  matrix: TAffineMatrix;  path: TBGRAPath;begin    matrix := AffineMatrixIdentity;    matrix *= AffineMatrixTranslation(Bitmap.Width div 2, Bitmap.Height div 2);    matrix *= AffineMatrixScale(0.4,0.75);    matrix *= AffineMatrixRotationDeg(35.0);    matrix *= AffineMatrixTranslation(-Bitmap.Width div 2, -Bitmap.Height div 2);   path := TBGRAPath.Create;    path.moveTo(10, 10);    path.lineTo(Bitmap.Width-10, 10);    path.lineTo(Bitmap.Width-10, Bitmap.Height-10);    path.lineTo(10, Bitmap.Height-10);    path.lineTo(10, Bitmap.Height-20);    path.bezierCurveTo(Bitmap.Width-20, Bitmap.Height-20,                     Bitmap.Width-20, 20,                       10, 20);    path.closePath;     Bitmap.Pen.JoinStyle := pjsMiter;    Bitmap.Pen.StrokeMatrix := matrix;     Bitmap.FillPath(path, matrix, BGRA(160,180,80));    Bitmap.DrawPath(path, matrix, BGRA(120,100,0), 6);     path.Free;end; You can switch between the two examples 5 and 6 by commenting out the line that sets the StrokeMatrix property. I would still say it is not a "black box". Is AGG a "black box" for having the TAgg2D class? No because you can rewrite it using lower level functions. Same thing with BGRABitmap, you can rewrite the example above by computing explicitly the array of points, multiplying by the matrix, creating the polygon filler and calling the DrawShape procedure. ---------------------------------------------------------------------- Akira1364 · 2016-07-17 21:39 Quote from: Graeme on July 17, 2016, 07:46:40 pmYou clearly don't understand AGG/AggPas then. It renders to any image buffer, which can even be something as simple as a byte array. It also supports many more pixel formats to what BGRABitmap can - in fact, BGRABitmap only supports BGRA (8-bit color channels) formats. Simply tell AGG/AggPas the image buffer it can use (most classes that represent an image gives you access to the raw image data) - LCL does, VCL does and fpGUI does. The TAgg2D class makes that a single method call - TAgg2D.Attach (bitmap, flip_y): boolean; I understand it. What you're describing isn't the same thing as what I was referring to. A TAgg2D is basically a canvas on steroids that can, as you said, attach itself and draw to buffers of arbitrary type. A TBGRABitmap is an actual image class that behaves like you would expect an image class to behave (i.e. with full SaveTo, LoadFrom functionality, e.t.c.) that works with pretty much every file format while also having three different canvases (CanvasBGRA, Canvas2D, and normal Canvas) built into it that can draw directly to its image data. Quote from: Graeme on July 17, 2016, 07:46:40 pmWell, considering that AGG/AggPas is a 2D graphics library by design, that makes perfect sense then. ;-) It never had a design goal to be a 3D graphics library. If you want a 3D graphics library, look elsewhere like at OpenGL or equivalents with hardware acceleration. As near as I can tell, BGRABitmap didn't originally set out with any 3D aspirations either, and it's still by and large a 2D-focused library. The point is though that is has 3D capabilities now. ---------------------------------------------------------------------- circular · 2016-07-18 10:12 I suppose it would be possible to add some 3D features to AggPas as it already has perspective transform. So by plugging this with an algorithm to compute the 2D points of a 3D scene, that would do. ---------------------------------------------------------------------- Handoko · 2016-07-18 10:44 Glad to know BGRABitmap become so feature-rich. Does it support Android? ---------------------------------------------------------------------- circular · 2016-07-18 11:40 BGRABitmap is in principle cross-platform, and on top of that there are some optimizations and fixes for different platforms and processors. Some people seem to have successfully done things on Android with BGRABitmap: http://forum.lazarus.freepascal.org/index.php?topic=19066.0 And on WinCE: http://forum.lazarus.freepascal.org/index.php/topic,12411.msg81152.htm l#msg81152 The main optimization that needs to be implemented for a specific platform is the direct pixel access. Otherwise, it uses LCL functions to generate a bitmap from the data, which is a bit slower. Currently this optimizations is basically done on Windows and Linux. There might also been some adjustments needed for OpenGL as for some system it is OpenGL ES which does not have the same features. So basically, you can try a platform and if you find it does not work or that it is slow, I invite you to create a thread in the BGRABitmap section of the forum and me or someone else will be happy to help find a way of improving it. ---------------------------------------------------------------------- Graeme · 2016-07-18 12:34 Quote from: circular on July 17, 2016, 08:19:42 pmIs AGG a "black box" for having the TAgg2D class? TAgg2D was actually added much later to AGG - simply to show that you can implement a all-in-one Canvas like class. It was never meant for day-to-day usage. But as I've come to realise, so many developers are engrained with the idea of one class must be able to do everything, so many tend to use TAgg2D instead of exploring the powers of loosely coupled features. ---------------------------------------------------------------------- Graeme · 2016-07-18 12:56 Quote from: Akira1364 on July 17, 2016, 11:39:26 pmA TBGRABitmap is an actual image class that behaves like you would expect an image class to behave (i.e. with full SaveTo, LoadFrom functionality, e.t.c.)... And that is where I fundamentally disagree with such designs. In your above text you now mention that a 2D graphics library also does file handling, unicode or code page conversion of file names, file format handling, streaming etc... That's an awful lot of non 2D graphics functionality thrown it. My design philosophy: Keep it simple and let each class do one thing only, and do that thing very well. One a side note:   It's also exactly the reason I hate LCL's TStringGrid's LoadFromCSVFile() method. What   if I wanted to load from a JSON or XML file? More examples include VirtualTreeView - is that a treeview, grid,   listview or all of the above? Also LCL's TListView - is that a list, grid, report etc component? Too much   functionality in a single class and makes in very prone to bugs.   fpGUI's StringGrid "load from CSV file" solution is a separate TStringGridBuilder   class that takes a StringGrid as a parameter. CSV, JSON, XML etc functionality is kept totally separate   from the TfpgStringGrid class. QuoteAs near as I can tell, BGRABitmap didn't originally set out with any 3D aspirations either, and it's still by and large a 2D-focused library. The point is though that is has 3D capabilities now. I have no interest in 3D at all, so I'll leave that exercise for somebody else to play with. But like Circular mentioned, AggPas already has rotate, transform, perspective functionality, so it shouldn't be hard to implement a TAgg3D class. ---------------------------------------------------------------------- circular · 2016-07-18 14:20 Quote from: Graeme on July 18, 2016, 02:56:46 pmQuote from: Akira1364 on July 17, 2016, 11:39:26 pmA TBGRABitmap is an actual image class that behaves like you would expect an image class to behave (i.e. with full SaveTo, LoadFrom functionality, e.t.c.)... And that is where I fundamentally disagree with such designs. In your above text you now mention that a 2D graphics library also does file handling, unicode or code page conversion of file names, file format handling, streaming etc... That's an awful lot of non 2D graphics functionality thrown it.You can use LoadFromStream if you don't want to use LoadFromFile. And having no ability to read a stream, you would like a class that just takes pointers? And if really you don't want any of the reading mechanism, you can still make your own framework and call the SetPixel function. Also it is not fair to say that file format handling is in the class. There are readers and writers, directly from the FreePascal readers/writers for image files or based on the same abstract class. You can define your own reader if you like. QuoteMy design philosophy: Keep it simple and let each class do one thing only, and do that thing very well.I don't find AGG to be simple personally. I would agree that classes are small, but not that they are simple to understand. My philosophy is rather: if someone wants something, let's give it. If someone wants something a bit more special, let's give the components to do that. So every feature is as much as possible given a simple function, that enables to use it without understanding its inner workings. There may be some things you cannot do with the provided functions, but then, you can simply dig a bit further according to how motivated you are to do so. QuoteIt's also exactly the reason I hate LCL's TStringGrid's LoadFromCSVFile() method. What   if I wanted to load from a JSON or XML file?You don't need to hate it. You can ask to have readers and writers just like for images or provide a patch that would do that. QuoteAlso LCL's TListView - is that a list, grid, report etc component? Too much   functionality in a single class and makes in very prone to bugs.Are you worried about bugs and you find it reassuring that AGG classes are small and that would prevent bugs? QuotefpGUI's StringGrid "load from CSV file" solution is a separate TStringGridBuilder   class that takes a StringGrid as a parameter. CSV, JSON, XML etc functionality is kept totally separate   from the TfpgStringGrid class.That's good. And you don't need to hate LCL version to value your own version. QuoteI have no interest in 3D at all, so I'll leave that exercise for somebody else to play with. But like Circular mentioned, AggPas already has rotate, transform, perspective functionality, so it shouldn't be hard to implement a TAgg3D class.Yet that would still be a lot for a user that does not have hours to spend on that. Basically you are saying AGG is better because it lets you program something, but that's not an actual fact, that's a potential. It is like saying a big promise is better than an actual gift. Quote from: Graeme on July 18, 2016, 02:34:58 pmTAgg2D was actually added much later to AGG - simply to show that you can implement a all- in-one Canvas like class. It was never meant for day-to-day usage. But as I've come to realise, so many developers are engrained with the idea of one class must be able to do everything so many tend to use TAgg2D instead of exploring the powers of loosely coupled features.I hear two things. That you are sad that people are not more using the loosely coupled features. On that I would tend to be also enthusiastic about people trying to use the more specialized class of BGRABitmap. The other thing I hear is that you say the developers don't use them because they are mentally conditioned. On that I would say that yes there are habits, but the more fundamental reason is that it takes time and energy to learn to use loosely coupled features. When you are focused on achieving something, having to program everything at a low level can become an obstacle to your creativity. ---------------------------------------------------------------------- Handoko · 2016-07-18 16:58 Hello, both of you are awesome. I think it's about personal preference. I like the idea mentioned by Graeme. As describe in here: https://en.wikipedia.org/wiki/KISS_principle https://en.wikipedia.org/wiki/Unix_philosophy Anyways, I just have a peek at BGRABitmap. It has good tutorials, good for beginners like me. Great. ---------------------------------------------------------------------- circular · 2016-07-18 17:34 Quote from: Handoko on July 18, 2016, 06:58:12 pmHello, both of you are awesome.Thank you. ---------------------------------------------------------------------- engkin · 2016-07-18 18:25 Am I right that only three facts are mentioned here when comparing AggPas and BGRABitmap: 1-Pixel format. 2-Speed. 3-One is low level mainly, and lacks a simple interface while the other has both. Did I miss anything else apart from I like and you like, and my design philosophy and your design philosophy? ---------------------------------------------------------------------- circular · 2016-07-18 20:14 Yes, the difference in terms of features: QuoteAggPas has some 2D transformation features for path and images that are not available in BGRABitmap and better SVG support BGRABitmap has Phong shading, Foyd-Steinberg dithering and color number reduction, lots of ready-to-use filters, OpenGL 2D and 3D acceleration, lots of raster image formats including layered images ---------------------------------------------------------------------- engkin · 2016-07-18 20:20 Quote from: circular on July 18, 2016, 10:14:40 pmYes, the difference in terms of features: QuoteAggPas has some 2D transformation features for path and images that are not available in BGRABitmap and better SVG support BGRABitmap has Phong shading, Foyd-Steinberg dithering and color number reduction, lots of ready-to-use filters, OpenGL 2D and 3D acceleration, lots of raster image formats including layered images Thank you. ---------------------------------------------------------------------- Graeme · 2016-07-18 23:30 Quote from: circular on July 18, 2016, 04:20:16 pmAlso it is not fair to say that file format handling is in the class. Reading an earlier message from somebody else I guess I was a bit harsh there. If BGRABitmap is like an enhanced TBitmap/TGraphic/TImage class of sorts, then I guess direct image format handling should be a given, because the LCL and VCL classes have them. QuoteI don't find AGG to be simple personally. I would agree that classes are small, but not that they are simple to understand. I'm to old to keep spoon feeding every new developer that comes round. If they can't bother working through some tutorials, then I can't bother to help them. I work on a lot of open source projects and trying to scale down because I'm very busy at work and other personal interests. So my statement about working through some tutorials apply not just to AggPas, but to other components or frameworks too. eg: tiOPF, FPTest, DCPCrypt, OnGuard, fpGUI etc. QuoteQuoteIt's also exactly the reason I hate LCL's TStringGrid's LoadFromCSVFile() method. What   if I wanted to load from a JSON or XML file?You don't need to hate it. You can ask to have readers and writers just like for images or provide a patch that would do that. The problem being, such methods were introduced, and now used by others. So you can't just remove them to clean up the crappy API. You first have to deprecate them for a release or two - that's if you are willing to break somebody's code. QuoteAre you worried about bugs and you find it reassuring that AGG classes are small and that would prevent bugs? Always, and again that doesn't just apply to AggPas, but to other frameworks too. It is well knows that if you have a 1000 line procedure it is prone to bugs and hard to fix - compared to many smaller and to-the-point procedures. The latter is infinitely easier to debug, unit test etc. Quote And you don't need to hate LCL version to value your own version.It is a crappy design. Somebody wanted to populate a StringGrid from a CSV file and created a method in TStringGrid to do that. Scratch your own itch. No thought about good design. They were too lazy to come up with a better and more flexible solution. The person that introduced that method should start reading books about Design Patterns. A quick search in my git repository reveals those CSV methods were introduced back in 2011 as commit r32179. ---------------------------------------------------------------------- jesusr · 2016-07-19 08:20 Quote from: Graeme on July 18, 2016, 02:56:46 pmOne a side note:   It's also exactly the reason I hate LCL's TStringGrid's LoadFromCSVFile() method. What   if I wanted to load from a JSON or XML file? More examples include VirtualTreeView - is that a treeview, grid,   listview or all of the above? Also LCL's TListView - is that a list, grid, report etc component? Too much   functionality in a single class and makes in very prone to bugs.   fpGUI's StringGrid "load from CSV file" solution is a separate TStringGridBuilder   class that takes a StringGrid as a parameter. CSV, JSON, XML etc functionality is kept totally separate   from the TfpgStringGrid class. Would your grid allow to be filled by just any xml or json file?, if it so, it must be an exceptional implementation because it doesn't sound right comparing a fixed file format like a csv versus something completely arbitrary like json or xml. There are reasons for and against on having this feature implemented within TStringGrid, not everything is black and white. ---------------------------------------------------------------------- jesusr · 2016-07-19 08:41 QuoteQuote And you don't need to hate LCL version to value your own version.It is a crappy design. Somebody wanted to populate a StringGrid from a CSV file and created a method in TStringGrid to do that. Scratch your own itch. No thought about good design. They were too lazy to come up with a better and more flexible solution. The person that introduced that method should start reading books about Design Patterns. A quick search in my git repository reveals those CSV methods were introduced back in 2011 as commit r32179. Oh, with so many arrows pointing to the bad guy, the bad guy feels the need to answer. Yep, he may start reading those books, or not, or maybe he have read some... But the bad guy remembers how difficult or impossible is to please everybody and specially to Graeme, because he one day is in love with it, the next day he hate it, now he love it again, ups now he really hate it again, simply no way. Yep I'm not talking about grids. . ---------------------------------------------------------------------- Graeme · 2016-07-19 08:47 Quote from: jesusr on July 19, 2016, 10:20:23 amWould your grid allow to be filled by just any xml or json file? I moved my reply to a new thread.   http://forum.lazarus.freepascal.org/index.php/topic,33405.msg216419. html ---------------------------------------------------------------------- Graeme · 2016-07-19 08:52 Quote from: jesusr on July 19, 2016, 10:41:17 am...because he one day is in love with it, the next day he hate it, now he love it again, ups now he really hate it again, Sorry mate, I have no idea what you are trying to say. ---------------------------------------------------------------------- circular · 2016-07-19 10:11 This thread is the continuation of a previous conversation so I would like to copy here some elements that I find relevant in the discussion. Here is the comparison on how to do the same thing with BGRABitmap and AggPas. Drawing joined shapes: https://github.com/bgrabitmap/lazpaint/blob/master/bgraaggtest/gouraud _main.pas (BGRABitmap) https://github.com/CWBudde/AggPasMod/blob/master/Examples/Simple/Goura ud.dpr (modernized AggPas) https://github.com/graemeg/fpGUI/blob/maint/src/corelib/render/softwar e/agg-demos/gouraud.dpr (classic AggPas) http://antigrain.com/demo/gouraud.png (screenshot) Doing a custom gradient and applying a mask to it: https://github.com/bgrabitmap/lazpaint/blob/master/bgraaggtest/alpha_g radient_main.pas (BGRABitmap) https://github.com/CWBudde/AggPasMod/blob/master/Examples/Simple/Alpha Gradient.dpr (modernized AggPas) https://github.com/graemeg/fpGUI/blob/maint/src/corelib/render/softwar e/agg-demos/alpha_gradient.dpr (classic AggPas) http://antigrain.com/demo/alpha_gradient.png (approximate screenshot but you can see a bit the shapes and mask) ---------------------------------------------------------------------- circular · 2016-07-19 10:21 Quote from: Graeme on July 19, 2016, 01:30:16 amI'm to old to keep spoon feeding every new developer that comes round. If they can't bother working through some tutorials, then I can't bother to help them. I work on a lot of open source projects and trying to scale down because I'm very busy at work and other personal interests. So my statement about working through some tutorials apply not just to AggPas, but to other components or frameworks too. eg: tiOPF, FPTest, DCPCrypt, OnGuard, fpGUI etc.Is it that you would like to help new developers however you have the impression you need to do a lot for each and that it is not doable? QuoteThe problem being, such methods were introduced, and now used by others. So you can't just remove them to clean up the crappy API. You first have to deprecate them for a release or two - that's if you are willing to break somebody's code.I thought about this. It is possible to keep the existing method, but that internally it would call the new API, like creating the CSV reader. QuoteAlways, and again that doesn't just apply to AggPas, but to other frameworks too. It is well knows that if you have a 1000 line procedure it is prone to bugs and hard to fix - compared to many smaller and to-the-point procedures. The latter is infinitely easier to debug, unit test etc.I would agree in general with that. That's why I am trying to trim classes in my project as I have the time to do so. QuoteIt is a crappy design. Somebody wanted to populate a StringGrid from a CSV file and created a method in TStringGrid to do that. Scratch your own itch.Well at some point someone does the things that are done, no? QuoteNo thought about good design. They were too lazy to come up with a better and more flexible solution. The person that introduced that method should start reading books about Design Patterns.I am not comfortable calling people lazy. We have only a certain amount of spare time. ---------------------------------------------------------------------- Graeme · 2016-07-19 11:28 Quote from: circular on July 19, 2016, 12:21:55 pmIs it that you would like to help new developers however you have the impression you need to do a lot for each and that it is not doable? Correct. I enjoy helping others (time permitting), but as long as I see they actually tried themselves too.  Too many new developers want everything done for them with exact step-by-step instructions given (or even the complete solution). Nobody will learn that way. I started programming because I like the challenge of solving a problem, coming up with a good design and learning new things (better myself). ---------------------------------------------------------------------- lainz · 2016-07-22 21:15 Well I never will develop a graphics library like bgrabitmap and a widgetset like fpGUI, hopefully you and circular are here Who is the best library depends on the user. I never used AggPas so I can't say. I started using the default Canvas (PaintBox). Then I used bgrabitmap to have transparency. Of course I can program things by myself, to many years trying! But when something is already done I can use it to save time, like the whole Lazarus. The things are programmed in the way the programmer things, I encountered software that I can't read and software readable, software easy to use and software impossible to understand for me. So if it's somewhat in the middle of easy and hard I can learn how to use it.