public static LImage GetResize(LImage image, int w, int h) { if (image == null) { return null; } if (image.width == w && image.height == h) { return image; } LImage result = LImage.CreateImage(w, h, image.HasAlpha()); LGraphics g = result.GetLGraphics(); g.DrawImage(image, 0, 0, w, h, 0, 0, image.GetWidth(), image.GetHeight()); g.Dispose(); return result; }
public static LImage GetResize(LImage image, int w, int h) { if (image == null) { return(null); } if (image.width == w && image.height == h) { return(image); } LImage result = LImage.CreateImage(w, h, image.HasAlpha()); LGraphics g = result.GetLGraphics(); g.DrawImage(image, 0, 0, w, h, 0, 0, image.GetWidth(), image.GetHeight()); g.Dispose(); return(result); }