Topic: Changes in visual components
Added in project DIBSection.cs.
Example - smallbalancechart.cs
Changes: lines 213, 335, 496.
Create and Test Forex Strategies
You are not logged in. Please login or register.
Forex Software → Developers Forum → Changes in visual components
Added in project DIBSection.cs.
Example - smallbalancechart.cs
Changes: lines 213, 335, 496.
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?
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.
P.S.
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...
This contribution is truly amassing !!!!!!!!!!!!!
Thank you again!!!!!!
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 !!
I am glad though a little to be useful in your huge work.
Forex Software → Developers Forum → Changes in visual components
Powered by PunBB, supported by Informer Technologies, Inc.