From: <ob...@us...> - 2006-08-04 16:04:56
|
Revision: 10868 Author: obones Date: 2006-08-04 09:04:45 -0700 (Fri, 04 Aug 2006) ViewCVS: http://svn.sourceforge.net/jvcl/?rev=10868&view=rev Log Message: ----------- Mantis 3851: Now uses a TIcon to draw the glyph and avoid alpha channel problems. Modified Paths: -------------- trunk/jvcl/run/JvTransparentButton.pas Modified: trunk/jvcl/run/JvTransparentButton.pas =================================================================== --- trunk/jvcl/run/JvTransparentButton.pas 2006-08-04 07:15:24 UTC (rev 10867) +++ trunk/jvcl/run/JvTransparentButton.pas 2006-08-04 16:04:45 UTC (rev 10868) @@ -1118,6 +1118,7 @@ var Index: TImageIndex; HelpRect: TRect; + Icon: TIcon; begin if FImList.Count = 0 then Exit; @@ -1198,15 +1199,15 @@ Self.Canvas.FillRect(HelpRect); end; - FImList.Draw(Canvas, ARect.Left, ARect.Top, Index); - (*{$IFDEF VCL} - ImageList_DrawEx(FImList.Handle, Index, Canvas.Handle, ARect.Left, ARect.Top, 0, 0, - clNone, clNone, ILD_TRANSPARENT); - {$ENDIF VCL} - {$IFDEF VisualCLX} - FImList.Draw(Canvas, ARect.Left, ARect.Top, Index); - {$ENDIF VisualCLX}*) + // Use a TIcon instead of FImList.Draw to avoid triggering Mantis 3851 + Icon := TIcon.Create; + try + FImList.GetIcon(Index, Icon); + Canvas.Draw(ARect.Left, ARect.Top, Icon); + finally + Icon.Free; + end; end; function TJvTransparentButton.GetUseImages: Boolean; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |