From e589293637f8ce693a7cb336960ef05d01e33d6f Mon Sep 17 00:00:00 2001 From: Jaex Date: Sun, 9 Aug 2020 05:46:36 +0300 Subject: [PATCH] Added draw method with image parameter --- ShareX.HelpersLib/Colors/GradientInfo.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ShareX.HelpersLib/Colors/GradientInfo.cs b/ShareX.HelpersLib/Colors/GradientInfo.cs index 7136afa5c..1972677d5 100644 --- a/ShareX.HelpersLib/Colors/GradientInfo.cs +++ b/ShareX.HelpersLib/Colors/GradientInfo.cs @@ -127,6 +127,17 @@ public void Draw(Graphics g, Rectangle rect) } } + public void Draw(Image img) + { + if (IsValid) + { + using (Graphics g = Graphics.FromImage(img)) + { + Draw(g, new Rectangle(0, 0, img.Width, img.Height)); + } + } + } + public Bitmap CreateGradientPreview(int width, int height, bool border = false, bool checkers = false) { Bitmap bmp = new Bitmap(width, height);