Solved

Invalidating an outline? or something?

Posted on 2000-03-25
3
145 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
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now