Bitmap über button legen
-
Hi Leuts,
mittels BS_BITMAP kann man ja ein bitmap als button nehmen,
das prob ist: wenn ich ein bitmap lade, verwandelt sich der schöööne XP button
in ein ordinäres 3D vieh. Dabei ist das bitmap von den ausmaßen kleiner als der button.Nun meine Fragen :
a) wie behalte ich den XP style für den button?
b) wie kann ich in das bitmap zusätzlich eine farbe als transparent markieren
(wenn winapi das beim laden einer jpg,gif net automatisch erkennt) ?seid gegrüßt
-
Eine transparaente Frabe kann man IMHO mit LoadImage ersetzen.
Ansonsten lies mal die Infos zu den Button-Stilen:
http://msdn.microsoft.com/en-us/library/bb775951(VS.85).aspxThe appearance of text or an icon or both on a button control depends on the BS_ICON and BS_BITMAP styles, and whether the BM_SETIMAGE message is sent. The possible results are as follows.
BS_ICON or BS_BITMAP set? BM_SETIMAGE called? Result
Yes Yes Show icon only.
No Yes Show icon and text.
Yes No Show text only.
No No Show text onlyAnsonsten gibt es genug Anleitungen für Ownerdraw Buttons.
http://www.codeproject.com/KB/buttons/imagebuttonwithstyle.aspx
http://www.codeproject.com/KB/buttons/cxpstylebuttonst.aspxAuch wenn das MFC Code ist lässt sich dieser für den Ownerdraw Part leicht übernehmen.