Page 1 of 1

Did something happen to FillRectangle?

Posted: Tue Apr 19, 2011 3:31 pm
by 15659034
In my AfterDraw for a TChart I used

Code: Select all

g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width,rect.Height)
I used this to draw a rectangle from where I first clicked to the current mouse position.

However, after installing the latest (TeeChartNET2010VSNET2010_4.1.2011.04193) TChart it started to draw a rectangle from the mouse position to the topleft corner. Dragging the mouse down and right, I could drag the topleft of the rectangle down and right. In the debugger rect.Width and rect.Height typical would have the values 1 and 1 at the start of drawing.

I have now replaced the code with the following:

Code: Select all

g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width + rect.X,  rect.Height+rect.Y)
And that works.

This is the current AfterDraw:

Code: Select all

 Private Sub TChart2_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart2.AfterDraw

        Dim rect As Rectangle = gCurrentSelection

'g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width,rect.Height)
        g.FillRectangle(New SolidBrush(Color.FromArgb(128, Color.DarkOrange)), rect.X, rect.Y, rect.Width + rect.X, rect.Y + rect.Height)

   
    End Sub

Re: Did something happen to FillRectangle?

Posted: Thu Apr 21, 2011 6:37 am
by 15659034
Well, since I am using FillRectangle and also have the fear that it could be my program logic that has become unstable I did the legwork and installed the earlier version, "TeeChartNET2010VSNET2010_4.0.2011.02083".

The old 4.0 version fills the rectangle as expected (from the documentation), from (X,Y) and with width and height (Width,Height).
The new 4.1 version fills the rectangle from (X,Y) to the location (Width,Height).

I really do not care which way it fills, as long as it does it consistently.

This is the code I used, one TChart1 needed.

Code: Select all

Public Class Form1

    Private Sub TChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart1.AfterDraw
'In 4.0 the blue rectangle in the smallest.
'In 4.1 the pink rectangle is the smallest.
        g.FillRectangle(Brushes.Blue, 100, 100, 10, 10)
        g.FillRectangle(Brushes.Pink, 150, 150, 160, 160)

    End Sub
End Class
I do of course realize that the odds are that I am doing something terrible wrong somewhere...

Re: Did something happen to FillRectangle?

Posted: Thu Apr 21, 2011 10:02 am
by 10050769
Hello Anton,

Thanks for your information. We have reproduce this and added it in bug list report with number[TF02015539] and now is fixed for next maintenance release of TeeChart.Net. And also I recommend you to be aware at this forum, our RSS news feed, Steema Software's twitter or facebook accounts for new release announcements and what's implemented on them.

Thanks,