[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Invalidating an outline? or something?

Posted on 2000-03-25
3
Medium Priority
?
154 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 400 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

649 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