POSTING SECOND TIME: drawing getting lost in my window - Programmer

This is a discussion on POSTING SECOND TIME: drawing getting lost in my window - Programmer ; Hi all, I draw lines using OnLButtonDown, OnMouseMove and OnLButtonUp handlers with functions MoveTo(pt), and LineTo(pt1) with dc->SetROP2(R2_COPYPEN) in OnLButtonUP. what happens is, i get the lines drawn after giving points but after when i bring different window w.g explorer ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: POSTING SECOND TIME: drawing getting lost in my window

  1. POSTING SECOND TIME: drawing getting lost in my window

    Hi all,
    I draw lines using OnLButtonDown,
    OnMouseMove and OnLButtonUp handlers with
    functions MoveTo(pt), and
    LineTo(pt1) with dc->SetROP2(R2_COPYPEN)
    in OnLButtonUP.

    what happens is, i get the lines drawn after giving points
    but after when i bring different window w.g explorer in front of my
    window using alt+tab , and again switch back to
    my window, i get clean window , my lines
    are gone. I want lines to stay there and
    visible in my window even i go back and
    forth. how to achieve that should
    i save it in CMetafileDC and playback
    in OnPaint handler.
    please suggest.
    thanks a lot.
    Lee.




    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

  2. Re: POSTING SECOND TIME: drawing getting lost in my window

    Have a look at the scribble tutorial. Basically, you need to store the
    points, and draw them in OnDraw (or OnPaint if you want a different drawing
    for screen and printer). Use InvalidateRect(...) wisely, and make sure you
    check that points need to be drawn before drawing them (the CRect method
    PtInRect should help there).

    Jase

    "Yang Lee" wrote in message
    news:3db2038c606af2fba154a4b1943a0ff8.93862@mygate .mailgate.org...
    > Hi all,
    > I draw lines using OnLButtonDown,
    > OnMouseMove and OnLButtonUp handlers with
    > functions MoveTo(pt), and
    > LineTo(pt1) with dc->SetROP2(R2_COPYPEN)
    > in OnLButtonUP.
    >
    > what happens is, i get the lines drawn after giving points
    > but after when i bring different window w.g explorer in front of my
    > window using alt+tab , and again switch back to
    > my window, i get clean window , my lines
    > are gone. I want lines to stay there and
    > visible in my window even i go back and
    > forth. how to achieve that should
    > i save it in CMetafileDC and playback
    > in OnPaint handler.
    > please suggest.
    > thanks a lot.
    > Lee.
    >
    >
    >
    >
    > --
    > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG




+ Reply to Thread