Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 19:57:35 +0000



[User Discussion] - SC Structure Support for p_GDIFunction

View Count: 4228

[2013-04-20 04:46:10]
ejtrader - Posts: 688
SC Team - Thank you for recent addition of the function - p_GDIFunction.

When your time permits - Would you please add the following to this?

- Pass SC Structure or any parameters to the function
sc.p_GDIFunction = DrawToChart(???) -> Looking for an ability to pass any parameters to this function - mainly X,Y - co-ordinates and any possible colors combination rather than using Global Variables.

- Ability to use sc.FreeDLL = 1; --> This might be tricky to implement and even if this is not implemented it's fine.. But if there is any possibility for this to get implemented - it would help in a great deal.

Thanks

Date Time Of Last Edit: 2013-04-20 19:18:09
[2013-04-23 02:30:21]
Sierra Chart Engineering - Posts: 104368
Both of these are very difficult to support, and are not planned right now.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-04-23 15:58:20]
ejtrader - Posts: 688
Thanks SC Team. Perfectly understandable.

- It seems the pixel co-ordinates based on the following functions work fine with GDI but when they are used with GDI+ - there are alignment issues. They seem to be offset by some amount and seems to be related to the Window border or something.

sc.BarIndexToXPixelCoordinate()
sc.RegionValueToYPixelCoordinate()

Wondering if there is any way to get them aligned in GDI+ as GDI+ seems to be a better option for it's rich graphics as well as GPU usage compared to CPU usage in GDI.

Thanks


imageSC_GDI_No_Alignment_Issues.png / V - Attached On 2013-04-23 15:55:52 UTC - Size: 12.07 KB - 748 views
imageSC_GDIPlus_Alignment_Issues.png / V - Attached On 2013-04-23 15:56:54 UTC - Size: 12.66 KB - 761 views
Attachment Deleted.
[2013-04-23 19:10:35]
ejtrader - Posts: 688
Wondering - if the alignment issues in GDI+ are related to these functions being (int,int)?

In GDI+ - a point is referred as - PointF(0.8f, 1.6f) ? Had to <Type-Cast> the values to make into PointF structure.

Thanks
Date Time Of Last Edit: 2013-04-23 19:15:01
[2013-04-24 16:13:47]
ejtrader - Posts: 688
- One issue noticed and wondering if there is any solution available:

- The text that is displayed through(drawtext method) - would disappear when Crosshair is selected and comes back when cross hair is turned off. Wondering if there are any tips to solve this issue. ( looking around to see if I can find any solution to this ).

Overall this is really a "BIG" step towards supporting User graphics :) and impressed so far...

Thanks
[2013-04-25 22:14:14]
Sierra Chart Engineering - Posts: 104368
We have received many emails from you. It is policy that the information must be posted on this Support Board unless it is something clearly private which it is not. We also only have a limited amount of time to look this over and not certain when we will be able to get to it.

Anything sent by email, needs to be posted here, otherwise we will disregard it.


- The text that is displayed through(drawtext method) - would disappear when Crosshair is selected and comes back when cross hair is turned off. Wondering if there are any tips to solve this issue. ( looking around to see if I can find any solution to this ).
Make sure that you set the foreground color and also restore the foreground color back to the prior color when done.

In general, there is just some setting you are missing when setting up the device context. Always be sure to restore any changes to the device context when done.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-04-25 22:17:08
[2013-04-25 22:15:34]
Sierra Chart Engineering - Posts: 104368
Not familiar with GDI plus. Have not used it.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-04-25 22:27:04]
ejtrader - Posts: 688
Thanks SC Team.

As you have mentioned you are not familiar with GDI+ - Would like to build my own functions for Pixel Co-ordinates.

If the following functions are not proprietary - Would you be able to share the source code for the following functions. Based on this I would build this myself and would expand for GDI+.

sc.BarIndexToXPixelCoordinate();
sc.RegionValueToYPixelCoordinate();

Thanks
[2013-04-25 22:39:24]
Sierra Chart Engineering - Posts: 104368
The source code would not help because these have a dependency upon other functions and those have a dependency on other variables and functionality. It's just too complex to help with that.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-04-25 22:42:39]
ejtrader - Posts: 688
OK - Thanks.

Would you please help out on this - portion of Preserving the Foreground color?

I don't see this being part of - GetStockObject function. If this text issue is solved - would continue to use GDI functions until I find an alternate work around. Even if you can update the example to draw some text(preferably with a different color) and preserve it when cross hair is selected - can take it from there.

Thanks
Date Time Of Last Edit: 2013-04-25 22:44:18
[2013-04-25 23:30:01]
ejtrader - Posts: 688
Attached are the images describing the problem - I am preserving the prior Pen & Brush between calls. and Not changing anything other than Pen color in the draw call.

Thanks

imageSC_Crosshair_Text_Blank.png / V - Attached On 2013-04-25 23:28:41 UTC - Size: 4.58 KB - 724 views
imageSC_NOCrossHair_Text_Fine.png / V - Attached On 2013-04-25 23:29:05 UTC - Size: 5.13 KB - 762 views
[2013-04-26 16:46:39]
ejtrader - Posts: 688
SC Team - Found the solution for the Text issue - when crosshair is selected.. Had to explicitly mark the text color in drawcode - which resolved the issue for me. This has nothing to do with preserving/restoring background/foreground colors in the function code.

Good to proceed further on this..

Thanks
Date Time Of Last Edit: 2013-04-26 16:58:52
[2013-04-26 17:50:46]
ejtrader - Posts: 688
Have a feature request in this space - if you don't see a technical issue and easy to implement :
- At present when the option under - Tools -> Tool Settings -> Show/Hide Tool Values window When Tool Activated/Deactivated - In this condition - you launch a child window. Would it be possible to create a similar function for this activity to launch a custom window?

Little background:
- In tradestation & Ninja - One would be able to create a custom window - and one can have a custom trade manager window or Custom T&S windows created based on individual needs. This would provide lot of flexibility to improve the core functionality to individual needs.

Please consider this feature request - if you don't see any technical issues with this request and reasonably easy to implement this.

Thanks

Couple of links where using similar feature - few advanced tools are built:

http://www.bigmiketrading.com/elite-circle/25431-vvminitradepanel.html
http://www.bigmiketrading.com/elite-circle/22235-aggregated-time-sales.html

jigsaw custom tools - http://www.youtube.com/watch?v=dknFokoPD2E etc and much more custom functionality can be built based on individual needs..

Thanks

Date Time Of Last Edit: 2013-04-26 19:42:51
[2013-04-28 16:45:07]
ejtrader - Posts: 688
SC Team - Don't know if you are following thread or not - now that you have marked this thread as User Discussion. In case if you do - Just wanted to update you that even GDI+ works as well with this structure.

One interesting observation is - When a line is drawn from point 1 to poin 2 - If they are painted through p_GDIFunction - Everything works fine.

When the same points are used through own WindowDC - they are off by some means. Wondering if you do any co-ordinate transformation within the function - p_GDIFunction? Basically if these co-ordinates can be aligned with own WindowDC function - Technically "SC" structure can be exposed as well with custom function - with the call - DrawPaint(sc,hwnd); - hwnd is just the window handle and within the function - HDC can be declared directly

if you can shed some light on this it would be much appreciated. Not expecting you would answer this - but "hoping" you would answer as exposing SC structure would be a "complete" solution to support this GDI :)

Thanks

http://www.sierrachart.com/image.php?l=1367176716538.png




main()
{
sc.p_GDIFunction = DrawGraph; //Co-ordinates are fine but SC structure is not available to the function

HWND hwnd = sc.ChartWindowHandle;
DrawGraphOwnDC(sc, hwnd); // If the same co-ordinates are used with this method - they are off on screen but advantage is 'SC' structure is available
}

void DrawGraph(HWND hwnd, HDC hdc)
{
// draw commands -- These graphs align well
}

void DrawGraphOwnDC(SCStudyInterfaceRef sc, HWND hwnd)
{
HDC hdc = GetWindowDC(hwnd);
// draw commands -- These graphs are off by few pixels
}

Date Time Of Last Edit: 2013-04-28 19:18:59

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account