Autor Beitrag
Default112
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Sa 17.07.04 20:22 
OK. Probelm: Ich habe 2 Image Komponenten übereinander gelegt. Auf der Unteren wird ein Bild angezeigt und auf der oberen soll man zeichnen können. Aber: Die obere Zeichenfläche wird weiss und ich kann das darunterliegende Bild nicht mehr sehen.

Wäre schön, wenn da nen Ausweg gefunden werden könnte, thx.
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Sa 17.07.04 20:48 
Moin!

Ausweg? Klar: male nicht auf den TImage's rum, sondern male selber auf der Form oder nutze eine TPaintBox. Dort kannst du im OnPaint Ereignis dann erst das Bild malen und dann Transparent dein gemaltes Bild raufmalen. Oder du machst es dir einfacher und malst direkt auf das Bild...

MfG
Muetze1
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 17.07.04 20:49 
Bei der ober Image-Komponente

Transparent := True;

setzen und dann den TransparentColor festlegen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Default112 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Sa 17.07.04 21:54 
Ok.

Das mit der Paintbox funktioniert, aber kann ich das Bild, was ich da gezeichnet habe irgendwie temporär speichern und später wieder aufrufen?



Das mit Transparent := True hab ich schon, aber TransparentColor? Wo kann ich das denn setzen?
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Sa 17.07.04 23:54 
Moin!

TransparentColor ist eine Eigenschaft von TBitmaps.

Und das Speichern des Bildes ist doch kein Problem: Male auf einem TBitmap und übertrage das beim OnPaint einfach auf das Canvas der PaintBox.

MfG
Muetze1
Default112 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: So 18.07.04 10:21 
Das mit dem Transparent bekomme ich nich hin :/ Ich habe Transparent := true gesetzt und Image1.Picture.Bitmap.TransparentColor := clWhite gesetzt, dennoch habe ich eine weisse Fläche, wo ich nicht durchgucken kann.

Meine Problem:

1. Benutze ich die Image Komponente ist sie undurchsichtig.
2. Benutze ich die PaintBox Komponente kann ich sie nicht speichern bzw. laden.

Eins der beiden Probleme muss ich lösen.

Thx
Def
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: So 18.07.04 15:49 
Moin!

Das was du alles im OnPaint der PaintBox malst kannst du doch einfach mal in eine Procedure auslagern die einen Canvas übergeben bekommt. So kannst du dann diese Procedure im OnPaint der PaintBox aufrufen und ihr den Canvas der PaintBox geben und zum Speichern legst du dir einfach ein TBitmap an und rufst wieder diese Procedure auf, nur diesmal mit dem Canvas des TBitmap - welches du dann ohne Probleme mit SaveToFile() speichern kannst.

MfG
Muetze1