I know there is code kicking around for drawing an icon in a disabled state using the old mask part of a picture object, but here is what I am using with the new alpha channel feature..
this code is taken from the "2011r4 Alpha Channel Support.txt" file included with the IDE and will convert an old picture object to a new picture object with alpha channel
Function ModernizePicture(input as Picture) as Picture
if input.hasAlphaChannel then return input
dim result as new Picture( input.width, input.height )
result.graphics.drawPicture( input, 0, 0 )
return result
End Function
this code will draw the picture with 50% transparency giving it a disabled (dimmed) look..
Function GetDisabledImage(pImage As Picture) As Picture
if (pImage <> NIL) then
DIM tPicture As NEW Picture(pImage.Width, pImage.Height)
tPicture.Graphics.Transparency = 50.0
tPicture.Graphics.DrawPicture ModernizePicture(pImage), 0, 0, pImage.Width, pImage.Height
Return tPicture
end if
End Function
I am sure many others have already figured this out, but I was unable to find any sample code with the new alpha channel feature, so thought I would share and hopefully save someone a few minutes (or hours)