If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

ScreenCapture & Imgur API

Problem/Overview

One of the toughest things in terms of hard to work with APIs is the Imgur API, it is very uh, well it isn't necessarily made for .NET - Most of my projects I work on are in VB.NET, so I need to be able to do certain things. One of my goals was in my Browser Project was to have a ScreenCapture program, with automatic upload to Imgur AND copy the link, or insert into a TextBox- And with that in mind, along of the help of a friend, as well as the Web Extensions Library, it is possible to do just that. Yes, there are older examples of this, but they are outdated, and no longer valid or just plainly bad examples.

One of the things, most of the examples in C# excluded was how to get the link to the image you just uploaded. While the code on how to upload is a bit older, and there seems to be nothing on the documentation, between myself and the friend, we managed to get it working.

License

All Source Code is Licensed under the MIT License - The license can be found in the Respo for this CodeBank Entry.

Start off by opening a new project - Add a reference to the System.Web.Extensions - Add 2 Buttons, "Capture" & "Save"

To Capture an Image, you can do this by making a Bitmap of your Screen, you can edit this, and even make a snipping tool to only capture certain areas, for the sake of this tutorial we will be doing a full screen capture.

If you want to Auto-Save, you can by calling it during the capture or on a timer.

Posting to Imgur

To Post to Imgur, as well as get the link to either your clipboard or to a Textbox, you first create a webrequest, then parse the response, and get the Link to the image.

Getting a link to the image will not show it on the normal Imgur website instead this is a direct link, all uploads using this process is anonymous you can add abilities to be under user's personal accounts.

You also need a API key, to do this - you can get the Client ID - over on the Imgur API site.

Unless said otherwise (e.g. From one of my projects thus, those are mostly licensed under MIT) - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.