CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    94

    Resizing polygon

    Hi, can anybody give me some suggestion on how to resize a polygon proportionately? for example, if a triangle needs to be enlarged by 20%, is there any method rather than doing mathematical calculation. I'm drawing the polygon using GraphicPath method with the points of the polygon kept in an Point[].
    Thanks for any help.

  2. #2
    Join Date
    Mar 2006
    Location
    Craiova, Romania
    Posts
    439

    Re: Resizing polygon

    AFAIK there is no way; even drawing on a panel that will enlarge with form enlarging will not resize it . You have to compute it .
    Bogdan

    If someone helped you then please Rate his post and mark the thread as Resolved
    Please improve your messages appearance by using tags [ code] Place your code here [ /code]

  3. #3
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646

    Re: Resizing polygon

    You need to recalculate but it is a simple task to do using the matrix class
    Code:
    using System.Drawing.Drawing2D;
    
    private void ScaleTwiceAsBig()
    {
                Point[] myPoints;
                Matrix m = new Matrix();
                m.Scale(2, 2);
                m.TransformPoints(myPoints);
                m.Dispose();
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured