Login Page - Create Account

Support Board


Date/Time: Fri, 22 Nov 2024 09:26:47 +0000



Post From: SC Structure Support for p_GDIFunction

[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