Solved

Invalidating an outline? or something?

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 72
ORA-01403: no data found 43 116
lucky13 challenge 11 164
JQuery serialize and unserialize 8 264
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: 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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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