AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Eigene Brush-Styles mit Transparenz
Thema durchsuchen
Ansicht
Themen-Optionen

Eigene Brush-Styles mit Transparenz

Ein Thema von Meflin · begonnen am 4. Jun 2007 · letzter Beitrag vom 5. Jun 2007
 
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#5

Re: Eigene Brush-Styles mit Transparenz

  Alt 5. Jun 2007, 11:11
...konnte man an dem schnipsel nicht sehen. vielleicht hast du da ja irgendwas anderes im scope...

kann es sein, dass bitmap.transparent eine reine VCL-Sache ist und BitBlt nicht die bohne interessiert?

Außerdem:

- warum nennst du eine VCL-TBitmap-Instanz hBitmap?
- wo lädst du das muster in das bitmap? (oder verlässt du dich darauf, dass das bitmaap gefälligst komplett weiß ist?)

EDIT: Ah ja, I see.

Der in dem Thread vorgeschlagene lösungsweg ist folgender:

- Muster (mit entsprechendem $keyColor) in $tempBitmap malen
- $tempBitmap.Transparent := true, $tempBitmap.TransparentColor := $keyColor
- $tempBitmap aufs $this.Canvas malen

Hmm. Dann machst du das alles ganz ordentlich.

Aber pack doch mal das Rectangle über die transparenz-zuweisungen.

So zum Beispiel:

Delphi-Quellcode:
  //temp-bitmap initialisieren
  hBitmap := Graphics.TBitmap.Create;
  hBitmap.Width := Width;
  hBitmap.Height := Height;
  hBitmap.Canvas.Brush.Style := BrushStyle;
  hBitmap.Canvas.Brush.Color := BrushColor;
  hBitmap.Canvas.Pen.Style := psClear;
  if (fBrushBitmap.Bitmap <> nil) and (not fBrushBitmap.Bitmap.Empty) then begin
    hBitmap.Canvas.Brush.Bitmap := fBrushBitmap.Bitmap;
  end;
  //aufs temp-bitmap den brush zeichnen
  hBitmap.Canvas.Rectangle(0, 0, Width + 1, Height + 1);
  //temp-bitmap transparent schalten
  hBitmap.TransparentColor := TransparentColor;
  hBitmap.Transparent := true;
  hBitmap.TransparentMode := tmFixed;
  
  //temp-bitmap auf canvas kopieren
  Canvas.CopyRect(rect(0,0,Width,Height),hBitmap.Canvas,rect(0,0,Width,Height);
  // BitBlt(Canvas.Handle, 0, 0, Width, Height, hBitmap.Canvas.Handle, 0, 0, SRCCOPY);
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:03 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