Exemplo n.º 1
0
 public static void DrawTinted(this Graphics gfx, Rectangle bakeRectangle, Image baseBake, ColorAlpha color)
 {
     using (var attrs = new ImageAttributes())
     {
         var mat = new ColorMatrix();
         mat.ApplyTint(color);
         attrs.SetColorMatrix(mat);
         gfx.DrawImage(baseBake, bakeRectangle, 0, 0, baseBake.Width, baseBake.Height, GraphicsUnit.Pixel, attrs);
     }
 }