Solved

Invalidating an outline? or something?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to include alternate header placement and naming 5 66
dog bark java program 15 87
Smart Camera scanning and reading information 3 99
fix34  challenge 9 104
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 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

17 Experts available now in Live!

Get 1:1 Help Now