Seite 1 von 1
disable Icon ? [erledigt]
Verfasst: So, 01. Mär 2015 9:43
von AUGE_OHR
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 ?
Re: disable Icon ?
Verfasst: Do, 05. Mär 2015 23:58
von AUGE_OHR
eine Lösung von Diego A. Kerejeta
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
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
XbpBitmap
public.xbase++.support.en
8. Februar 2015
wer also mit 32PP Bitmaps arbeitet und eine "saubere" Lösung benötigt wende sich an Diego.