Autor Beitrag
Chrischuh
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 124
Erhaltene Danke: 1

Win 7
Turbo Delphi
BeitragVerfasst: Mo 25.02.08 19:10 
Hallo,

ich möchte auf einem Timage mit canvas etwas zeichnen und später auf Befehl wieder die Zeichnung vom Timage entfernen.

Wie lautet dieser Befehl?



Chrischuh
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mo 25.02.08 19:18 
Hi,

Du möchtest also, dass NUR die vom Canvas frisch gezeichnete Zeichnung gelöscht wird oder, dass das Image komplett leer ist danach?

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Chrischuh Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 124
Erhaltene Danke: 1

Win 7
Turbo Delphi
BeitragVerfasst: Mo 25.02.08 19:44 
1. Normales Bild
2. mit Canvas einige Lienien zeichnen
3. Canvas löschen
4. wieder wie am Anfang, also normales Bild
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 25.02.08 19:53 
Moin!

Du hast user profile iconHidden nicht richtig verstanden: es geht darum, ob du auf das Canvas des TImage oder auf das Canvas eines eventuell darin enthaltenen Bitmaps zeichnest. :idea:

Am besten zeigst du mal deinen "Zeichnen-Code". ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Chrischuh Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 124
Erhaltene Danke: 1

Win 7
Turbo Delphi
BeitragVerfasst: Mo 25.02.08 20:09 
in dem image ist ein Bitmap

Dei erste Linie:
ausblenden Delphi-Quelltext
1:
2:
image1.Canvas.MoveTo(808,534);
image1.Canvas.LineTo(805,306);


dann soll später nur die Linie gelöscht werden(auf dem Canvas ist nur die Linie)

und dann wieder andere Linien

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mo 25.02.08 20:13 
Hi,

bitte benutze Delphi-Tags.([delphi] quelltext [/delphi])

Außerdem wäre noch zu klären, ob du nur "radieren" möchtest(zeichnen mit Farbe gleich Hintergrundfarbe) oder das image löschen.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 25.02.08 20:15 
Moin!

Probier mal:
ausblenden Delphi-Quelltext
1:
2:
Image1.Invalidate;
Application.ProcessMessages;

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Chrischuh Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 124
Erhaltene Danke: 1

Win 7
Turbo Delphi
BeitragVerfasst: Mo 25.02.08 20:33 
Das mit radieren hat funktioniert(weil ich ein Photo als image habe sieht man die radierspuren).

Hatte eigentlich gedacht, das man das canvas-bild mit einem befehl einfach löschen kann.


Image1.Invalidate;
Application.ProcessMessages;

hat irgendwie nicht funktioniert.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 25.02.08 20:44 
Moin!

Dann:
ausblenden Delphi-Quelltext
1:
Image1.Picture.Bitmap := NIL;					

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Mo 25.02.08 22:17 
Eine unschöne, aber funktionierende Methode:

ausblenden Delphi-Quelltext
1:
Image1.Picture.Bitmap.Canvas.FillRect(Rect(0, 0, Image11.Picture.Bitmap.Width, Image1.Picture.Bitmap.Height));					

Vorher musst du evtl. noch Image1.Picture.Bitmap.Canvas.Brush.Color auf die Hintergrundfarbe setzen.
P_G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 75

Win XP
Delphi 7 / 8 Enterprise
BeitragVerfasst: Di 26.02.08 10:37 
Hi,
ist auch über API-Befehl möglich:

ausblenden Delphi-Quelltext
1:
PatBLT(Image1.Picture.Bitmap.Canvas.Handle, 0, 0, Image1.Width, Image1.Height, clWhite);					


Gruß, P_G