Topic: Changes in visual components

Added in project DIBSection.cs.
Example - smallbalancechart.cs
Changes: lines 213, 335, 496.

Post's attachments

UserInterface.rar 6.28 kb, 9 downloads since 2013-01-26 

You don't have the permssions to download the attachments of this post.

Re: Changes in visual components

Can you explain why drawing on bitmap is better than drawing directly on a control? Where in other places in programs we can use this technique?

3 (edited by serfel 2013-01-28 15:52:00)

Re: Changes in visual components

Drawing to a bitmap in memory will be faster than drawing to the screen. If re-drawing the entire screen on every update, then much better off composing the bitmap and then blitting that bitmap to the screen. If updating only part of the screen, then you have to weigh whether multiple blits to the screen will be faster than composing the bitmap and drawing the entire thing to the screen.
In general, is better off composing the bitmap in memory and then writing the composed bitmap to the screen. That's usually faster, and also reduces the flicker that you'll see if overlapping regions are updated in quick succession. Replace smallbalancechart please, and you'll see changes. But replace namespace in my version. I replace it for using the same custom indicators.
I thinks, it are possible to apply this technique in all visual components of type ...chart (for example, in PnlPricePaint(), in PnlIndPaint() etc., in all OnPaint()) in Forex Strategy Builder and in Forex Strategy Trader. The difference in speed of work on chart on which there was a lot of indicators are especially appreciable.

Re: Changes in visual components

I assumes that DrawLine, for example, used the finish functions, type of SetPixel which included capture of a context, drawing of a point and clearing of a context. Thus, drawing of an one line are reduc to drawing of a set of points with a large quantity of operations unnecessary in this case and superfluous steps of the processor. GDI + are optimiz disgustingly. BitBlt carried out only the problem - copying of the block of memory. And if there was a lot of bars or many indicators, then... poor processor...

Re: Changes in visual components

This contribution is truly amassing !!!!!!!!!!!!!

Thank you again!!!!!!


Re: Changes in visual components

serfel - The suggested change have made a massive difference (for the better) in the UI components of FSB.  Thanks for the suggestions.

popov - Thanks for the rapid release of these UI changes.

Awesome Work !!

Re: Changes in visual components

I am glad though a little to be useful in your huge work.