Autor Beitrag
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 31.05.03 13:41 
Ich programmiere gerade eine Uhr-Komponente und habe keinen Plan wie ich es anstellen soll, dass Der Hintergrund durchsichtig (=nicht sichtbar) wird.

Ich zeichne nichts direkt auf das Canvas der Komponente sondern in den Speicher (DBuffer: TBitmap)
ausblenden Delphi-Quelltext
1:
2:
Canvas.Draw(0,0,DBuffer);
DBuffer.free;

TransparentColor und TransparentMode weiß ich net wie funzt...

Thx, Fis
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 31.05.03 15:50 
Wenn der untere, linke Pixel die Farbe hat, die du Transparent haben möchtest (z.B. weiß oder grau oder auch Fuchsia), dann reicht es, die Transparent-Werte auf den Standardeinstellungen zu lassen und einfach
ausblenden Delphi-Quelltext
1:
2:
3:
DBuffer.Transparent := True;
Canvas.Draw(0,0,DBuffer);
DBuffer.free;

zu benutzen.
Wenn nicht, musst du gucken, welche Farbe du transparent haben willst und folgendes machen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
DBuffer.TransparentMode := tmFixed;
DBuffer.TransparentColor := [die gewünschte farbe];
DBuffer.Transparent := True;
Canvas.Draw(0,0,DBuffer);
DBuffer.Free;

zu benutzen.
Die Farbe kannst du sowohl als Farbconstante (z.B. clWhite, clBack usw) angeben, als auch als RGB-Wert (z.B. $000000FF für Rot).

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert


Zuletzt bearbeitet von tommie-lie am Sa 31.05.03 17:14, insgesamt 1-mal bearbeitet
Tweafis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Sa 31.05.03 15:59 
ThxThXThX

aber ich hab trotzdem noch ein Problem (hat nichts mit Transparenz zu tun) *in neues Thema schreib*