Solved

Invalidating an outline? or something?

Posted on 2000-03-25
3
149 Views
Last Modified: 2013-11-20
I need help.
Now that we've established that, here's my question:

I'm trying to write a bunch of drawing tools that will help to draw a map. These include ellipses, rectangles, and polylines.

I want the program to invalidate the outline of the circle, I guess, and not the entire background. I have to be able to draw and still leave lines and other stuff behind the ellipse.

I'm using pDC->Ellipse(RECT lpRect) and other built-in MFC drawing functions.

So far I'm not invalidating anything at all so it still erases everything it goes over as you're drawing it.

Any suggestions? (My goal here is to be able to do something like MSPAINT where you can make it appear to simply draw outlines.)

Thanks in advance,
Dan
0
Comment
Question by:SuperMario
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Expert Comment

by:vachooho
ID: 2657040
see DRAWCLI example in MSDN
Hope it will help
0
 
LVL 30

Accepted Solution

by:
Axter earned 100 total points
ID: 2657747
Use the SelectStockObject(NULL_BRUSH);

For example, if you put the following code in your OnPaint function, it will draw a transparent circle:

RECT lpRect;
lpRect.left = 0;
lpRect.top = 0;
lpRect.right = 40;
lpRect.bottom = 40;
CBrush *OldBrush=NULL;
OldBrush = (CBrush*)dc.SelectStockObject(NULL_BRUSH);
dc.Ellipse(&lpRect) ;
if (OldBrush!=NULL) dc.SelectObject(OldBrush);

If you remove the OldBrush = (CBrush*)dc.SelectStockObject(NULL_BRUSH);
it will draw an OPAQUE circle.

0
 
LVL 3

Author Comment

by:SuperMario
ID: 2802750
Thank you!

-D
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question