public static FileInfo OfPath(string e) { FileInfo n = new FileInfo(); n.FullPath = e; return n; }
public static Image Of(FileInfo f) { Image n = new Image(); n.ImageFile = f; n.Open(); return n; }
public void SaveThumbnailAs(FileInfo fileInfo, int width) { int height = width * 3 / 4; object t1 = Native.API.imagecreatetruecolor(width, height); if (Height > Width) { int osh = Width * 3 / 4; Native.API.imagecopyresampled(t1, Handle, 0, 0, 0, osh / 2, width, height, Width, osh); } else { int osw = Height * 4 / 3; Native.API.imagecopyresampled(t1, Handle, 0, 0, 0, 0, width, height, osw, Height); } Native.API.imagejpeg(t1, fileInfo.FullPath, 100); }
public static Properties Of(FileInfo e) { return new Properties(e.Text); }