Einzelnen Beitrag anzeigen

Benutzerbild von Xong
Xong

Registriert seit: 9. Jan 2008
186 Beiträge
 
Delphi 2006 Professional
 
#4

Re: Ungewollte Transparenz bei einem ToolbarButton

  Alt 3. Nov 2008, 10:57
Der Support hat sich gemeldet.

Meine Email:
How to avoid transparency of an bitmap-image assigned to a TAdvToolbarButton?
Hi!

I am currently using your component TAdvToolBar to create a toolbar like it is described in the tutorial at http://www.tmssoftware.com/site/atbdev.asp
To create image-toolbarbuttons I assign an bitmap-image to the Glyph-property of the button. Unfortunatly, the image is drawn with transparency. The color of the pixel in the bottom left corner of the image is set as the transparency-color. I do not want to have this transparency.

How can I avoid this?

I tried to set the Transparent-property of the Glyph to false, but this affected nothing.
Do I have to call something like an Update-method to see the change?

My System is Windows 2003 with Borland Developer Studio 2003.

I am looking forward to hear from you soon.

Yours,
Robert Rupf

PS: I tried to set the Picture-property of the Button. If I use a bitmap-file the image has transparency, with a png-file i dont get transparency.
So, how can I allow to assign bitmaps (without transparency of course...)?


Die Antwort:
RE: How to avoid transparency of an bitmap-image assigned to a TAdvToolbarButton?
Currently, when a glyph is used , it is hardcoded that this glyph or
picture is drawn with transparency. If you do not want transparency,
this will have to be changed in the method

procedure TAdvCustomToolBarButton.DrawGlyphAndCaption

by removing the calls:

AGlyph.Transparent := true;

and

FPicture.Graphic.Transparent := true;

Thanks for your interest in our components and
let us know if we can be of any further help.



Meine Lösung:
Einfaches Überschreiben der Methode ist nicht möglich. Man muss die gesamte Komponente ändern.
Dafür legt man eine neue Unit im Projekt an, die genauso, wie die alte heißt, also AdvToolBar.pas.
Darin werden die zwei oben genannten Codezeilen auskommentiert und fertig ist das untransparente Bild.

Alternativ kann man natürlich auch eine eigene Komponente ableiten...

LG,
Xong
  Mit Zitat antworten Zitat