Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

VC++ 6 Graphics Help

gameplayergameplayer Member Posts: 2
I am using
VC++ 6.0, in WinXp

My problem is present in both Dialog app / SDI app
I am not able to draw under any mapmode other than MM_TEXT.

This is the code i used

CClientDC dc(this);
dc.SetMapMode(MM_LOMETRIC);
dc.MoveTo(100,100);
dc.LineTo(200,100);

The code compiles & executes but the line is not drawn.
If i use MM_TEXT Line is drawn.
The same happens for all other mapmodes.
Also i tried creating and selecting a pen.

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : I am using
    : VC++ 6.0, in WinXp
    :
    : My problem is present in both Dialog app / SDI app
    : I am not able to draw under any mapmode other than MM_TEXT.
    :
    : This is the code i used
    :
    : CClientDC dc(this);
    : dc.SetMapMode(MM_LOMETRIC);
    : dc.MoveTo(100,100);
    : dc.LineTo(200,100);
    :
    : The code compiles & executes but the line is not drawn.
    : If i use MM_TEXT Line is drawn.
    : The same happens for all other mapmodes.
    : Also i tried creating and selecting a pen.
    :
    :
    [color=Blue]MSDN, please:

    MM_LOMETRIC: Each logical unit is mapped to 0.1 millimeter. Positive x is to the right; positive y is [b]UP[/b].

    Try to change your code like this:
    [code]
    dc.MoveTo (100, [color=Red]-[/color]100);
    dc.LineTo (200, [color=Red]-[/color]100);
    [/code]
    [/color]
Sign In or Register to comment.