Can't draw the appropriate X


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Can't draw the appropriate X

  1. #1
    Rattagarn V Guest

    Can't draw the appropriate X


    Hi,
    I got some problem. I would like to draw the symmetry X symbol. So
    I used MoveToEx and LineTo. My code looks like this:

    Dim m_Area as RECT
    SetArea m_Area, 10, 10, 30, 30
    MoveToEx hDC, m_Area.Left + 2, m_Area.Top + 2
    LineTo hDC, m_Area.Right - 2, m_Area.Bottom - 2
    MoveToEx hDC, m_Area.Left + 2, m_Area.Bottom - 2
    LineTo hDC, m_Area.Right - 2, m_Area.Top + 2
    The result would be the X symbol, a symmetry one. Unfortunately, I've never
    got the symmetry one. The last line of drawing I have to set m_Area.Top
    + 2 to be m_Area.Top + 1. Even I used PolyPolyLine to draw, the result
    is the same. I don't know why this gonna be happen. Who can explain to
    me or I did anything wrong?

    Thank you very much
    Rattagarn V.

  2. #2
    Mike Guest

    Re: Can't draw the appropriate X


    Rattagarn,

    This is a guess, but I think that the API calls don't draw the last point,
    so you have to add one.

    Mike

    "Rattagarn V" <rattagarn@hotmail.com> wrote:
    >
    >Hi,
    > I got some problem. I would like to draw the symmetry X symbol.

    So
    >I used MoveToEx and LineTo. My code looks like this:
    >
    >Dim m_Area as RECT
    > SetArea m_Area, 10, 10, 30, 30
    > MoveToEx hDC, m_Area.Left + 2, m_Area.Top + 2
    > LineTo hDC, m_Area.Right - 2, m_Area.Bottom - 2
    > MoveToEx hDC, m_Area.Left + 2, m_Area.Bottom - 2
    > LineTo hDC, m_Area.Right - 2, m_Area.Top + 2
    >The result would be the X symbol, a symmetry one. Unfortunately, I've

    never
    >got the symmetry one. The last line of drawing I have to set m_Area.Top
    >+ 2 to be m_Area.Top + 1. Even I used PolyPolyLine to draw, the result
    >is the same. I don't know why this gonna be happen. Who can explain to
    >me or I did anything wrong?
    >
    >Thank you very much
    >Rattagarn V.



  3. #3
    Mike Guest

    Re: Can't draw the appropriate X


    Rattagarn,

    This is a guess, but I think that the API calls don't draw the last point,
    so you have to add one.

    Mike

    "Rattagarn V" <rattagarn@hotmail.com> wrote:
    >
    >Hi,
    > I got some problem. I would like to draw the symmetry X symbol.

    So
    >I used MoveToEx and LineTo. My code looks like this:
    >
    >Dim m_Area as RECT
    > SetArea m_Area, 10, 10, 30, 30
    > MoveToEx hDC, m_Area.Left + 2, m_Area.Top + 2
    > LineTo hDC, m_Area.Right - 2, m_Area.Bottom - 2
    > MoveToEx hDC, m_Area.Left + 2, m_Area.Bottom - 2
    > LineTo hDC, m_Area.Right - 2, m_Area.Top + 2
    >The result would be the X symbol, a symmetry one. Unfortunately, I've

    never
    >got the symmetry one. The last line of drawing I have to set m_Area.Top
    >+ 2 to be m_Area.Top + 1. Even I used PolyPolyLine to draw, the result
    >is the same. I don't know why this gonna be happen. Who can explain to
    >me or I did anything wrong?
    >
    >Thank you very much
    >Rattagarn V.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center