Skip to content

Instantly share code, notes, and snippets.

@nberardi
Last active December 20, 2015 22:09
Show Gist options
  • Save nberardi/6202829 to your computer and use it in GitHub Desktop.
Save nberardi/6202829 to your computer and use it in GitHub Desktop.
executify.csx
#r "System.Drawing.dll"
/*
* To use a GitHub Gist with Executify, you need to have a
* file named "executify.csx" in your Gist. Then you reference
* the Gist Identity in the Executify URL as
* http://executify.com/gist/{gist_id}
*/
using System.IO;
using System.Drawing;
using System.Net;
var client = new WebClient();
var bytes = client.DownloadData("http://www.hdwallpapersplus.com/wp-content/uploads/2013/05/Funny-Cat-Pictures-cats-935656_500_375.jpg");
var stream = new MemoryStream(bytes);
var image = Image.FromStream(stream);
Console.WriteLine("size: {0}x{1}", image.Height, image.Width);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment