ImageList_DrawIndirect() private method

private ImageList_DrawIndirect ( IMAGELISTDRAWPARAMS &pimldp ) : int
pimldp IMAGELISTDRAWPARAMS
return int
示例#1
0
 public void DrawImage(IntPtr hdc, int index, int x, int y, ImageListDrawItemConstants flags, int cx, int cy, Color foreColor, ImageListDrawStateConstants stateFlags, Color saturateColorOrAlpha, Color glowOrShadowColor)
 {
     SysImageList.IMAGELISTDRAWPARAMS iMAGELISTDRAWPARAMS = default(SysImageList.IMAGELISTDRAWPARAMS);
     iMAGELISTDRAWPARAMS.hdcDst = hdc;
     iMAGELISTDRAWPARAMS.cbSize = Marshal.SizeOf(iMAGELISTDRAWPARAMS.GetType());
     iMAGELISTDRAWPARAMS.i      = index;
     iMAGELISTDRAWPARAMS.x      = x;
     iMAGELISTDRAWPARAMS.y      = y;
     iMAGELISTDRAWPARAMS.cx     = cx;
     iMAGELISTDRAWPARAMS.cy     = cy;
     iMAGELISTDRAWPARAMS.rgbFg  = Color.FromArgb(0, (int)foreColor.R, (int)foreColor.G, (int)foreColor.B).ToArgb();
     Console.WriteLine("{0}", iMAGELISTDRAWPARAMS.rgbFg);
     iMAGELISTDRAWPARAMS.fStyle = (int)flags;
     iMAGELISTDRAWPARAMS.fState = (int)stateFlags;
     if ((stateFlags & ImageListDrawStateConstants.ILS_ALPHA) == ImageListDrawStateConstants.ILS_ALPHA)
     {
         iMAGELISTDRAWPARAMS.Frame = (int)saturateColorOrAlpha.A;
     }
     else if ((stateFlags & ImageListDrawStateConstants.ILS_SATURATE) == ImageListDrawStateConstants.ILS_SATURATE)
     {
         saturateColorOrAlpha      = Color.FromArgb(0, (int)saturateColorOrAlpha.R, (int)saturateColorOrAlpha.G, (int)saturateColorOrAlpha.B);
         iMAGELISTDRAWPARAMS.Frame = saturateColorOrAlpha.ToArgb();
     }
     glowOrShadowColor            = Color.FromArgb(0, (int)glowOrShadowColor.R, (int)glowOrShadowColor.G, (int)glowOrShadowColor.B);
     iMAGELISTDRAWPARAMS.crEffect = glowOrShadowColor.ToArgb();
     if (this.iImageList == null)
     {
         iMAGELISTDRAWPARAMS.himl = this.hIml;
         int num = SysImageList.ImageList_DrawIndirect(ref iMAGELISTDRAWPARAMS);
     }
     else
     {
         this.iImageList.Draw(ref iMAGELISTDRAWPARAMS);
     }
 }
示例#2
0
 public void DrawImage(IntPtr hdc, int index, int x, int y, ImageListDrawItemConstants flags, int cx, int cy)
 {
     SysImageList.IMAGELISTDRAWPARAMS iMAGELISTDRAWPARAMS = default(SysImageList.IMAGELISTDRAWPARAMS);
     iMAGELISTDRAWPARAMS.hdcDst = hdc;
     iMAGELISTDRAWPARAMS.cbSize = Marshal.SizeOf(iMAGELISTDRAWPARAMS.GetType());
     iMAGELISTDRAWPARAMS.i      = index;
     iMAGELISTDRAWPARAMS.x      = x;
     iMAGELISTDRAWPARAMS.y      = y;
     iMAGELISTDRAWPARAMS.cx     = cx;
     iMAGELISTDRAWPARAMS.cy     = cy;
     iMAGELISTDRAWPARAMS.fStyle = (int)flags;
     if (this.iImageList == null)
     {
         iMAGELISTDRAWPARAMS.himl = this.hIml;
         int num = SysImageList.ImageList_DrawIndirect(ref iMAGELISTDRAWPARAMS);
     }
     else
     {
         this.iImageList.Draw(ref iMAGELISTDRAWPARAMS);
     }
 }