hi,
wie bekommt man ein graues "Disable" Icon hin ?
für Bitmap gibt es ja die Function von Günter Beyes aber für Icon finde ich nichts ...
btw : wie lege ich ein neues Icon an ? eine oIcon:Make() gibt es wohl auch nicht ?
disable Icon ? [erledigt]
Moderator: Moderatoren
- AUGE_OHR
- Marvin
- Beiträge: 12909
- Registriert: Do, 16. Mär 2006 7:55
- Wohnort: Hamburg
- Hat sich bedankt: 19 Mal
- Danksagung erhalten: 46 Mal
Re: disable Icon ?
eine Lösung von Diego A. Kerejeta
p.s. die CreateDisabledBmp() Routine ist die von Günter Beyes.
Da diese zur XP Zeit entwickelt wurde scheinen 32PP Bitmaps damit nicht ganz korrekt zu funktionieren.
siehe auch Alaska Newsgroup
Code: Alles auswählen
STATIC DLLFUNCTION CreateIcon( p1, p2, p3, p4, p5, p6, p7 ) ;
USING STDCALL ;
FROM USER32.DLL
**************************************
FUNCTION CreateDisabledIcon( oIconIn )
**************************************
LOCAL oBmpIn := CreateDisabledBmp( oIconIn:getBitmap(), .T. )
LOCAL nBits := oBmpIn:bits
LOCAL cBuffer := oBmpIn:setBuffer()
LOCAL nBufferOffset := oBmpIn:bufferOffset
LOCAL nXSize := oBmpIn:xSize
LOCAL nYSize := oBmpIn:ySize
LOCAL nRowPadding := nXSize * nBits % 4
LOCAL nLastPixel := nBufferOffset + nXSize * nYSize * nBits + nRowPadding * ( nYSize - 1 )
LOCAL nRowLen := nXSize * nBits / 8 + nRowPadding
LOCAL cXORbitmask := ''
LOCAL nCont, hIcon, oIconOut
oBmpIn:destroy()
FOR nCont:= nBufferOffset + 1 TO nLastPixel STEP nRowLen
cXORbitmask:= SubStr( cBuffer, nCont, nRowLen ) + cXORbitmask
NEXT
hIcon = CreateIcon( 0, ; // application instance
nXSize, ; // icon width
nYSize, ; // icon height
1, ; // number of XOR planes
nBits, ; // number of bits per pixel
nil, ; // AND bitmask
cXORbitmask ) // XOR bitmask
oIconOut:= XbpIcon():new():create()
IF hIcon # 0
oIconOut:handle:= hIcon
oIconOut:getIconInfo()
ENDIF
RETURN oIconOut
Da diese zur XP Zeit entwickelt wurde scheinen 32PP Bitmaps damit nicht ganz korrekt zu funktionieren.
siehe auch Alaska Newsgroup
wer also mit 32PP Bitmaps arbeitet und eine "saubere" Lösung benötigt wende sich an Diego.XbpBitmap
public.xbase++.support.en
8. Februar 2015
gruss by OHR
Jimmy
Jimmy