Last active
December 20, 2015 22:09
-
-
Save nberardi/6202829 to your computer and use it in GitHub Desktop.
executify.csx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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