![]() |
[GELÖST]: Bilder/Bitmaps transparent in eine PaintBox laden
Hi!
Ich hab ein Programm, bei dem ich die images aus einer imagelist TRANSPARENT auf eine Paintbox zeichnen will. Leider klappt das nicht. (das transparente) Ich hab das Programm mal gezippt, ihr könnts euch ja mal anschauen. Vielen Dank für eure Hilfe :) (ich hab den Anhang gelöscht, da man dort eh ncht viel sieht (das Problem ist ja auch gelößt), und weils den Server schont) |
Re: transparenz klappt nicht
Och, weisst Du, ein Bild hätte es auch getan. Ich denke mal Du hast vielleicht nicht die korrekte TransparentColor definiert?
Sherlock |
Re: transparenz klappt nicht
Delphi-Quellcode:
Form2.transparentcolorvalue:=clWhite;
Form2.transparentcolor:=true; |
Re: transparenz klappt nicht
Nah, that would be to easy. He's drawing the images from the ImageList into a PaintBox. There're no options for transparent in a PaintBox. The ImageList has something with masks, but I don't quit understand the use. :gruebel:
Sherlock |
Re: transparenz klappt nicht
Are you able to use PNG's?If so then use delphi's PNG Image control(Timage).But its only avaliable in D2009 or D2007 too.
|
Re: transparenz klappt nicht
PNG is not natively supported in Delphi 2007. But maybe this could help:
![]() |
Re: transparenz klappt nicht
@deddy H:
wie soll das gehen? Ich check den Linkinhalt nicht :cry: |
Re: transparenz klappt nicht
Hier ist die Lösung:
man muss das Bitmap in ein Image laden. Das Image kann man ja transparent machen (unter eigenschaften) dann läd man das Image so in die PaintBox:
Delphi-Quellcode:
Nur so als Beispiel.
PaintBox1.Canvas.Draw(0, 50, Image1.Picture.Graphic);
PaintBox1.Canvas.Draw(0, 34, Image1.Picture.Graphic); |
Re: [GELÖST]: Bilder/Bitmaps transparent in eine PaintBox la
Das sieht mir aber sehr schlampig aus, wenn man da ein TImage mitschleifen muss, womöglich noch unsichtbar (schlimmer kann man die VCL meiner Meinung nach kaum einsetzen).
Vielleicht geht es auch nur mit einem TPicture. Probiert habe ich es nicht und super schön ist das wohl auch nicht. Aktuell wird das den Weg wohl nicht in die CL finden (du hast es ja dafür vorgeschlagen). ;) Es geht sicher schöner (irgendwie :gruebel: ). |
Re: [GELÖST]: Bilder/Bitmaps transparent in eine PaintBox la
@Matze: Es geht auch unter Verwendung von TPicture. TImage macht auch nix anderes als TPicture zur Datenhaltung zu verwenden.
Die aufgezeigte Variante halte ich auch für fragwürdig. Wozu ein TImage nutzen wenn man davon nur das TPicture verwendet? Das ist als würde ich den ganzen Schrank mit zum Essen nehmen obwohl ich nur das Besteck daraus benötige. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:12 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz