internal void DrawImageCore(Graphics g, Bitmap bmp, Rectangle srcRect, Rectangle destRect, float alpha) { if (alpha < 1) { var attr = new ImageAttributes (); float[][] matrixItems = new[] { new float[] { 1, 0, 0, 0, 0 }, new float[] { 0, 1, 0, 0, 0 }, new float[] { 0, 0, 1, 0, 0 }, new float[] { 0, 0, 0, alpha, 0 }, new float[] { 0, 0, 0, 0, 1 }, }; attr.SetColorMatrix (new ColorMatrix (matrixItems), ColorMatrixFlag.Default, ColorAdjustType.Bitmap); PointF[] points = new PointF[3]; points[0] = new PointF ((float) destRect.X, (float) destRect.Y); points[1] = new PointF ((float) (destRect.X + destRect.Width), (float) destRect.Y); points[2] = new PointF ((float) destRect.X, (float) (destRect.Y + destRect.Height)); g.DrawImage (bmp, points, srcRect.ToSDRectF (), GraphicsUnit.Pixel, attr); } else g.DrawImage (bmp, destRect.ToSDRectF (), srcRect.ToSDRectF (), GraphicsUnit.Pixel); }