I have recently updated my delphi from XE4 to XE6, but it is extremely slow to plot points using the TPointSeries series. I noticed the points to be anti-aliased, so I disabled that using chart_radar.Canvas := TTeeCanvas3D.Create. The anti-aliasing effect is gone, but the drawing of points remains slow.
Any idea what causes this change in efficiency and how to speed up drawing the points?
Related
I am trying to edit a 3D app project, written in XE7, on RAD Studio Berlin. It's a simple 3D app with a few dummy objects and a few meshes.
When I load the project, all of the objects are differently scaled and positioned than in XE7, objects are much smaller and repositioned. When I edit the scale, position and rotation variables, I can get similar results, but that's not the solution.
To simplify, I'd like to know how to open my XE7 3D project in RAD Studio 10.1 Berlin.
I wasn't careful enough (read:at all) so I've missed to see new property of Model3D object called WrapMode. It is set to FIT by default, switching to ORIGINAL solves the problem (which really isn't :) ). Big thanks to Rudy Velthuis and Dalija Prasnikar for the effort!
We were using Delphi 2010 with the full VCL edition of TeeChart this worked fine
We have now updated to Delphi XE 5 with the latest version of TeeChart and the quality of the charts is now worse
Please see the image here
2 bars which were seperate are now merged into 1 bar
If I make the charts wider which is not an option it looks better but still not as good as before
Please see here
Has anyone come across any issue like this?
The projects are here for Delphi XE5 and here for Delphi 2010
The search paths may need modifying
Cheers
Paul
The issue might be because of the anti-aliasing function being turned on by default in the newer versions of TChart(!).
We had the same issue with a line series graph.
After writing to the vendor (Steema) they came up with the following solution:
Chart1.Canvas := TTeeCanvas3D.Create; //Disable GDI+ to prevent smooth drawing of the graph.
I don't get why we have to switch off drawing with GDI+ as - to my knowledge - GDI+ can also be used without anti-alias.
Anyway, our graphs now behave like the previous versions of the TChart, which is what we want.
I was also hating the "new" anti-aliased charts that are blurry and slow.
It's pretty easy to fix, when you know where to search for.
Double-click on chart, then go to 3D -> Render -> select GDI instead of GDI+
If you look "behind the scenes" into DFM file you can see the change:
Crisp and fast graph (as in 2010): DefaultCanvas = 'TTeeCanvas3D'
Blurry and slow graph (as in XE5): DefaultCanvas = 'TGDIPlusCanvas'
chart settings
Hope this helps.
Some kind of a clumsy runtime workaround was found here, that is also working:
http://www.teechart.net/support/viewtopic.php?f=3&t=15078
An old-school graphics effect is palette animation, where for an image of (say) 256 colours, the palette that each color index of 0-255 refers to is shifted. As it shifts, the colours of each pixel change.
You can read more about the technique here and see a fantastic HTML5 reproduction of old-style effects here. Here is a plasma example from Wikipedia:
I would like to achieve the same effect in FireMonkey, using FMX TBitmaps or another inbuilt class. (I currently have TBitmaps - with static colours - built once-off from a table of values.) FMX is quite abstracted from the underlying OS, and also using underlying OS techniques will stop the app being cross-platform-compatible. On the other hand, since it uses DirectX or OpenGL under the hood, fast animation effects should be very possible. What's the best approach?
I am using Delphi XE2 (original FireMonkey) but a technique for anything up to XE4 (FMX 3) is fine too.
My Application Currently Crashes as soon the GDI object count reaches to 8800,IS there any way or setting I need to do so that the consumption of GDI by TeeChart Can be less.
You can increment the limit of your GDI objects in your Ms Windows configuration
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724291(v=vs.85).aspx
But, as you indicated in your question, you should reduce their use. I had some problems with GDI objects when changing the format of a huge number of cells on a grid. You could try not changing many colors or fonts in your chart.
Try using GDI+ TeeChart canvas instead of GDI.
My whole experience with direct use of graphics consists of drawing shapes using Turbo Pascal’s gdi unit on a 386 machine ages ago, finding it unbearably slow and never giving it a second thought. In other words, I have next to no idea where to begin.
For a simple Internet radio player application, I would like to design a graphic display somewhat similar to Winamp (but a bit larger and easier on the eyes, since the illegibility of such displays is one reason I’m trying to do my own).
Simple graphic components like those imitating LED displays are nowhere near sufficient, of course. I don’t expect to be drawing clickable UI controls, and certainly not skins – just the readout, with text, digits and a few symbols. I understand Delphi 2010 supports Direct2D, but I only have D2009.
What are my options? Are there any 3rd party components that would help?
On edit two small points. I need the drawing to be flicker-free (i.e,, unlike what I experienced all those years ago in Turbo Pascal :-). Is TCanvas going to be fast enough for that? Also, I would probably want to use alphablending, which I don't think I can get with the basic TextOut, LineTo etc. graphics API. (I just don't know what's possible). What about GDI+?
A library for fast 2D graphics for Delphi is available as open source on Sourceforge:
Graphics32 (home page: http://www.graphics32.org/)
Graphics32 is a graphics library for
Delphi and Kylix/CLX. Optimized for
32-bit pixel formats, it provides fast
operations with pixels and graphic
primitives. In most cases Graphics32
considerably outperforms the standard
TBitmap/TCanvas methods.
Features Some of Graphics32 features include:
Fast per-pixel access up to 100 times faster compared to standard TBitmap;
High-performance Bitmap alpha blending (including per-pixel alpha blending);
Pixel, line and polygon antialiasing with sub-pixel accuracy (combined with alpha blending);
Arbitrary polygon transformations and custom fillings;
Bitmap resampling with high quality reconstruction filters (e.g. Lanczos, Cubic, Mitchell);
A unique state-of-the-art rasterization system;
Affine transformations of bitmaps: rotations, scaling, etc with sub-pixel accuracy;
Arbitrary projective transformations of bitmaps;
Arbitrary remapping transformations of bitmaps (e.g. for Warping, Morphing);
Flexible supersampling implementation for maximum sampling quality;
Flicker-free image displaying components with optimized double buffering via advanced MicroTiles based repaint optimizer;
Multiple customizible easy-to-use overlay layers;
Locking of bitmaps for safe multithreading;
A property editor for RGB and alpha channel loading;
Design-time loading of image formats supported by standard TPicture;
Works on Borland Delphi, C++ Builder and Kylix (The last version that supported Kylix was 1.8.3).
As of version 1.5.1b Graphics32 is licensed under the terms of the Mozilla Public License.
Take a look at TCanvas. It's built into most visual controls and contains easy methods for the sort of simple drawing you're looking at, without the need for mucking around with DirectX or OpenGL. If you want a really simple surface you can draw on, place a blank TImage TPaintBox on the form and use its Canvas as your drawing surface.
Mostly I agree with Mason and the comments. TPaintBox is a very simple component really. You implement the OnPaint event and are in complete control. It is fast enough on a fast-enough machine.
Put it on a TScrollBox and you don't even need to worry about where the user has scrolled to :)
Make sure you check out the DoubleBufferred property of the parent control(panel/ScrollBox).
If it is a complex drawing/graphic also check out InvalidateRect - this controls which area of a canvas is redrawn.
Of course like all graphics/drawing it gets pretty complicated pretty quickly :(
Just saw your edit. If you need alpha blending and flicker-free drawing, TCanvas is probably not going to be good enough for you. You should look at components that wrap OpenGL or Direct3D and provide you a high-power graphics canvas.
One such package is Asphyre, though I'm not sure if they have a version that works on Delphi 2009+ yet. I've also got a custom-built library that wraps SDL 1.3 and gives you a drawing frame component you can place on a Delphi form. It does work on Delphi 2009 and later, but I haven't released it as its own package yet. You could find it if you dig around in the SVN archive of my game engine, but if you can wait a day or two I could try to get it made into an easily-usable BPL component package and available for download.