Did something happen to FillRectangle?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anton
Newbie
Newbie
Posts: 5
Joined: Mon Apr 11, 2011 12:00 am

Did something happen to FillRectangle?

Post by Anton » Tue Apr 19, 2011 3:31 pm

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

Anton
Newbie
Newbie
Posts: 5
Joined: Mon Apr 11, 2011 12:00 am

Re: Did something happen to FillRectangle?

Post by Anton » Thu Apr 21, 2011 6:37 am

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...

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Did something happen to FillRectangle?

Post by Sandra » Thu Apr 21, 2011 10:02 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply