Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 16:29:12 +0000



BUT: ACSIL UTF8 characters with new graphics functions not working

View Count: 640

[2023-11-01 07:33:38]
erwinbeckers - Posts: 22
I'm trying to draw some UF8 symbols on my chart like arrows, circles, rectangles but the new graphics functions don't show them
Here is a small snippet of what I'm trying to do:


SCInputRef bar_marker = sc.Input[0];
if (sc.SetDefaults)
{
...
bar_marker.Name = "UTF8 symbol";
bar_marker.SetString(u8"➘");
...
}
  
sc.p_GDIFunction = on_render();


void on_render(HWND WindowHandle, HDC hdc, SCStudyInterfaceRef sc)
{
sc.graphics.SetBackgroundMode(TRANSPARENT);
sc.graphics.SetTextColor(0xff0000);
sc.graphics.SetTextAlign(TA_NOUPDATECP | TA_LEFT);
auto bar_marker = sc.Input[0].GetString();
sc.graphics.DrawTextAt(bar_marker, 100,100);
}
[2023-11-01 22:45:39]
Sierra_Chart Engineering - Posts: 17182
We tested this and it works but only with GDI. You need to disable OpenGL.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-11-02 00:15:17]
erwinbeckers - Posts: 22
any plans to make it work with openGl as well?
[2023-11-02 02:32:36]
Sierra_Chart Engineering - Posts: 17182
We do not think this is going to work well. It would hurt performance to support so many characters with OpenGL.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-11-02 04:31:42]
User719512 - Posts: 264
I would use DrawPolygon, DrawRectangle, DrawEllipse/DrawEllipseWithRadius, MoveTo/LineTo and create any shape you want either based on origin or center of a rectangle of size X. Create a few helper functions and draw whatever images you want at BarIndexToXPixelCoordinate and RegionValueToYPixelCoordinate. The math involved is not terribly difficult.

Attaching a crude drawing to visualize the idea... Happy coding!
imagegdi arrows.png / V - Attached On 2023-11-02 04:30:33 UTC - Size: 14.61 KB - 95 views
[2023-11-02 19:13:20]
erwinbeckers - Posts: 22
That is indeed a workaround, but I would rather have it just working with openGL as well
[2023-11-03 18:04:57]
User719512 - Posts: 264
Arrows were pretty fun to build. Your post inspired me to add these to the other things I started working on now that GDI can be used with OpenGL (which finally makes doing this work worthwhile).
imageSierra GDI Arrows.png / V - Attached On 2023-11-03 18:04:18 UTC - Size: 2.62 KB - 99 views
[2023-11-05 01:17:21]
LudaTrades - Posts: 27
Arrows were pretty fun to build. Your post inspired me to add these to the other things I started working on now that GDI can be used with OpenGL (which finally makes doing this work worthwhile).

That's great, any chance you have an example study for this or similar? I'm trying to play with the opengl graphics but GDIExample.cpp has compile errors for deleted functions, so I'm a little lost.
[2023-11-05 02:53:49]
User719512 - Posts: 264
LudaTrades, I filed this ticket with Sierra since I assume you are using Remote Builds.

Remote Build for GDIExample.cpp gives errors about use of deleted functions

I build from Visual Studio, and everything is working fine. I have no insights into why the Remote Build server is busted.
[2023-11-08 23:09:13]
User719512 - Posts: 264
This is fixed by the header file updates to add constructors for the affected classes in v2563.

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

Login

Login Page - Create Account