Support Board
Date/Time: Sat, 23 Nov 2024 04:38:46 +0000
Post From: Detect changes in Window Size/scale
[2013-04-30 19:49:40] |
ejtrader - Posts: 688 |
Thank you SC team. However the problem at present is: As the SC Structure is not available to DrawChart function - need to "pre-polulate" the pixel information by a separate function let's say "PopulatePixels". This function need to be aware of the window size etc(what bars are visible, whether the High/Low Price visibility changed, did the scroll bar used which would make the visible bars changed etc all the time and need to be calculated constantly - and probably a little bit costly operation). At present only way to control this is to keep populating this information for every tick(PopulatePixels) - though the information might not necessarily changed. In general circumstances - we tend to reduce the CPU usage either calculate at the first tick or bar close but when it comes to GDI - we can't depend on the bar to close - there could be several events that are likely to change which would require PopulatePixels to be re-calculated - and this specific function - I want to trigger if there is an external function made available like "sc.ChangeWinProp". Even if you don't provide this function it's alright.. GDI support is probably one of the "best/Powerful" enhancements you have introduced to this platform recently that I can think of :) Just trying to best make use of it in an efficient manner.. If SC structure was available to "DrawChart" function - then it would be an entirely different story and what you mentioned about letting SC handle the populate/draw functions handled by draw function.. In any case - even if you don't make any further improvements in this area - this is good enough this way.. Thanks PopulatePixels(sc); // This needs to be called on every tick as this function is dependent on visible data on chart sc.p_GDIFunction = DrawChart; // Code in DrawChart would make use of the Global values populated by above function Ideally wanted to have the code like this if the window function was available: // pseudo Code if ( sc.WindowChanged or "Bar Number changed(pseudo)" ) PopulatePixels(sc); // I would imagine this might be an optimal way sc.p_GDIFunction = DrawChart; Date Time Of Last Edit: 2013-04-30 20:41:03
|