If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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?

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.

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.