Page 1 of 1

Access to the Graphics object

Posted: Fri Sep 08, 2006 3:51 pm
by 9641603
Hi,

I'm trying to do custom painting over a chart. I subscribe to the AfterDraw event. If I call chart.CreateGraphics() in my event handler, it works fine but whatever I paint gets painted over (I can see it's there because it flickers as I resize the chart).

The reason I want access to Graphics is that I need to paint a bitmap using InterpolationMode.NearestNeighbor. Graphics3D doesn't seem to support this functionality.

Best,
Michal

Posted: Tue Sep 12, 2006 10:42 am
by narcis
Hi Michal,

I'm afraid this is not possible because this method is not accessible.

Could you please send us an example we can run "as-is" to reproduce the problem here so that we can try to find a solution to your problem?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Posted: Tue Sep 12, 2006 2:54 pm
by 9641603
Hi,

Well, there isn't really an example I could send you.

However, I found a solution: one needs to create a class derived from TChart, override the OnPaint(), call base.OnPaint() first and then do whatever painting needs to be done.

Voila!

Best,
Michal Blazejczyk