05-19-2019, 04:33 AM
Try this:
Macro Macro62
Macro Macro62
str filename="c:\temp\flowers.jpg" ;; replace with your test picture here
int width = 256 ;; change width size
int height = 256 ;; change height size
CsExec("" F"''{filename}'' {width} {height}")
#ret
using System;
using System.Drawing;
public class Test
{
,static void Main(string[] p)
,{
,,using (var image = Image.FromFile(p[0]))
,,{
,,,int width = int.Parse(p[1]);
,,,int height = int.Parse(p[2]);
,,,using (var thumbnail = image.GetThumbnailImage(width, height, null, IntPtr.Zero))
,,,{
,,,,thumbnail.Save(@"c:\temp\thumbnail.png");
,,,,System.Diagnostics.Process.Start(@"c:\temp\thumbnail.png");
,,,}
,,}
,}
}