GDI background problem  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
radekj
Posts: 113
Joined: 28 Apr 2008
Has thanked: 20 times
Been thanked: 1 time

GDI background problem

Postby radekj » 10 Aug 2012

It seems that background is not full repainted each time
So there is no way to draw objects via GDI right !

If you change a position of a already draw object some old part of it will be still displayed.

We can not restore the old part of object background because MC give us only access
"AfterBGFill"-event and we never know when the whole background was fresh repainted.

ciao
radekj

PS: simple exampel, draw a current close-price near close via "g.DrawString()"

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: GDI background problem  [SOLVED]

Postby Dave Masalov » 10 Aug 2012

Hello radekj,

MC .NEt always returns the coordinates of the area that will be repainted via DrawContext.DrawRect. You should check if your object is located in the repainted area. Background is repainted only where it is needed. To tell MC .NET that some are should be repainted, you should pass its coordinates via the DrawContext.DirtyRect property.

radekj
Posts: 113
Joined: 28 Apr 2008
Has thanked: 20 times
Been thanked: 1 time

Re: GDI background problem

Postby radekj » 10 Aug 2012

Does not work !

i draw text on old-position (say rect is 100,100, 110, 110),
than i redraw it at new position (say rect is 100, 110, 110, 120)
and setting "context.DirtyRect" to old-position-text (Rect) and
nothing happens, same if i use "context.ReDraw = true".

I still see part of old text.

ciao
radekj

PS: link with snap of it :
http://screencast.com/t/2UXXtE72G

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: GDI background problem

Postby Dave Masalov » 10 Aug 2012

radekj,

Please send your code to support@multicharts.com for investigation.

radekj
Posts: 113
Joined: 28 Apr 2008
Has thanked: 20 times
Been thanked: 1 time

Re: GDI background problem

Postby radekj » 10 Aug 2012

Sorry, everything is as Dave Masalov wrote !

ciao
radekj


Return to “MultiCharts .NET”