Graphics - need to draw to the screen and then erase it
From: A.B. (someone_at_somewhere.com)
Date: 04/25/04
- Next message: patrox: "Re: Colors /16 bpp"
- Previous message: Nelson: "Re: Colors /16 bpp"
- Next in thread: Joćo Paulo Figueira [eMVP]: "Re: Graphics - need to draw to the screen and then erase it"
- Reply: Joćo Paulo Figueira [eMVP]: "Re: Graphics - need to draw to the screen and then erase it"
- Reply: Doug Forster: "Re: Graphics - need to draw to the screen and then erase it"
- Reply: A.B.: "Re: Graphics - need to draw to the screen and then erase it"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 25 Apr 2004 00:39:32 -0400
I'm working on a Dialog-based MFC project using eVC++ 4.0
This is what I'm doing that's working pretty well... All my line/rectangle
drawing is taking place inside the OnPaint() event. I draw a black rectangle
and then use lines to create a grid. I then draw sine-waves ontop of the
grid. (and I say it's working "pretty well" because there's a slight flicker
visible when I draw the black rectangle).
I now want to add a feature to allow the user to measure peaks, etc. of the
sine waves. So the user presses on the display with the stylus and a line is
drawn in parallel with the x-axis at the y point of where the user pressed
on the display (I make a call to Invalidate(FALSE) to keep the background
and just draw the line quickly). This part works too... HOWEVER, having to
redraw the grid and the wave takes a while and it looks silly to totally
refresh the screen when the user quickly presses on the screen with the
stylus.
What I'd like to do is:
1) detect the stylus pressing on the display and get the x,y coordinates (I
know how to)
2) before drawing the line over the sine-wave & grid I'd like to copy the
small area to memory first (I don't know how)
3) draw the line to measure the amplitude of the sine wave (I know how)
4) when the user presses somewhere else on the screen, erase the line by
copying the previously stored small area of the display over the line (I
don't know how)
Other things I've noticed... when I hold the stylus down on the display (to
initate the "right-mouse click") and the animated red-dots disappear when I
let go, the small area under that animation will get-rid of my line but keep
the background sine wave and grid unchanged. So maybe I don't even have to
BitBlt the background to memory after all - I just recreate whatever the
Operating System does when it clears the red-dot animation.
thankyou for any help...
- Next message: patrox: "Re: Colors /16 bpp"
- Previous message: Nelson: "Re: Colors /16 bpp"
- Next in thread: Joćo Paulo Figueira [eMVP]: "Re: Graphics - need to draw to the screen and then erase it"
- Reply: Joćo Paulo Figueira [eMVP]: "Re: Graphics - need to draw to the screen and then erase it"
- Reply: Doug Forster: "Re: Graphics - need to draw to the screen and then erase it"
- Reply: A.B.: "Re: Graphics - need to draw to the screen and then erase it"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|