Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,206 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,373 people online right now. Registration is fast and FREE... Join Now!




Deleting a Draw Line from canvas .

2 Pages V  1 2 >  
Reply to this topicStart new topic

Deleting a Draw Line from canvas ., Begginer Question i suppose .

Pationate
31 May, 2008 - 01:18 PM
Post #1

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 30


My Contributions
Lets say a drawn line is like this
CODE

Image1->Canvas->MoveTo(130,70);
Image1->Canvas->LineTo (250,200);


At the applications restart button i need this line to be erased .
How will i do that.

ps. Its probably an easy question but its kinda late and me brain doesnt work tongue.gif Thnx .
User is offlineProfile CardPM
+Quote Post

Pationate
RE: Deleting A Draw Line From Canvas .
31 May, 2008 - 02:39 PM
Post #2

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 30


My Contributions
Lots of viewers and no help yet sad.gif I hope its not that hard !!!
User is offlineProfile CardPM
+Quote Post

KYA
RE: Deleting A Draw Line From Canvas .
31 May, 2008 - 02:53 PM
Post #3

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,050



Thanked: 124 times
Dream Kudos: 1200
My Contributions
If these are standard drawing mechanisms from the WinAPI, an application restart will erase the screen. Unless you mean a button the user presses after a certain amount of time in which case, you can invalidate the window and force a repaint with whatever the background color is.
User is online!Profile CardPM
+Quote Post

Pationate
RE: Deleting A Draw Line From Canvas .
31 May, 2008 - 03:04 PM
Post #4

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 30


My Contributions
QUOTE(KYA @ 31 May, 2008 - 03:53 PM) *

If these are standard drawing mechanisms from the WinAPI, an application restart will erase the screen. Unless you mean a button the user presses after a certain amount of time in which case, you can invalidate the window and force a repaint with whatever the background color is.


The project is a simulation of a network and these lines indicate the connection of a device . There's a routine that disconnects a device from the network and that requires a specific line to be deleted or..."Unpainted" . Moreover i've got a "clear simulation" button that will erase all results and schemes so that you can start over from the beggining , and that also requires all the lines to be deleted .
It has to be a code that deletes a line ... I had a thought about repainting the same line .. with white color . (That didn't work)
User is offlineProfile CardPM
+Quote Post

KYA
RE: Deleting A Draw Line From Canvas .
31 May, 2008 - 04:16 PM
Post #5

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,050



Thanked: 124 times
Dream Kudos: 1200
My Contributions
Brush the entire window with your background color.
User is online!Profile CardPM
+Quote Post

Pationate
RE: Deleting A Draw Line From Canvas .
1 Jun, 2008 - 05:51 AM
Post #6

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 30


My Contributions
QUOTE(KYA @ 31 May, 2008 - 05:16 PM) *

Brush the entire window with your background color.



I need to delete specific lines ...

CODE
Image1->Canvas->MoveTo(360,100);
Image1->Canvas->LineTo (250,200);


I need to undo this line . Brushing all the canvas will erase them all .
User is offlineProfile CardPM
+Quote Post

KYA
RE: Deleting A Draw Line From Canvas .
1 Jun, 2008 - 05:57 AM
Post #7

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,050



Thanked: 124 times
Dream Kudos: 1200
My Contributions
Oh I misunderstood the question. When you tried tracing over that line with a white one what was the result? (You said it didn't work, but in what way did it not work?)

This post has been edited by KYA: 1 Jun, 2008 - 05:57 AM
User is online!Profile CardPM
+Quote Post

Pationate
RE: Deleting A Draw Line From Canvas .
1 Jun, 2008 - 05:59 AM
Post #8

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 30


My Contributions
QUOTE(KYA @ 1 Jun, 2008 - 06:57 AM) *

Oh I misunderstood the question. When you tried tracing over that line with a white one what was the result? (You said it didn't work, but in what way did it not work?)


It was still drawn black . I noticed like a wink ... but after that it was still black .
User is offlineProfile CardPM
+Quote Post

KYA
RE: Deleting A Draw Line From Canvas .
1 Jun, 2008 - 06:04 AM
Post #9

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,050



Thanked: 124 times
Dream Kudos: 1200
My Contributions
Was the window validated or invalidated after you attempted to paint it white?
User is online!Profile CardPM
+Quote Post

Pationate
RE: Deleting A Draw Line From Canvas .
1 Jun, 2008 - 06:07 AM
Post #10

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 30


My Contributions
QUOTE(KYA @ 1 Jun, 2008 - 07:04 AM) *

Was the window validated or invalidated after you attempted to paint it white?


I am not pretty sure about validating it or not ... I think it gets validated once the application beggins and doesnt get invalidated .
User is offlineProfile CardPM
+Quote Post

KYA
RE: Deleting A Draw Line From Canvas .
1 Jun, 2008 - 06:09 AM
Post #11

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,050



Thanked: 124 times
Dream Kudos: 1200
My Contributions
If you invalidate you can force a repaint and make the "white line" stay instead of a flicker.
User is online!Profile CardPM
+Quote Post

Pationate
RE: Deleting A Draw Line From Canvas .
1 Jun, 2008 - 06:15 AM
Post #12

New D.I.C Head
*

Joined: 30 May, 2008
Posts: 30


My Contributions
QUOTE(KYA @ 1 Jun, 2008 - 07:09 AM) *

If you invalidate you can force a repaint and make the "white line" stay instead of a flicker.


How do i invalidate ?
User is offlineProfile CardPM
+Quote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
Time is now: 12/4/08 12:38PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month