Refactoring which replaces the Image in the ImageOutput for an ISurface, this makes it possible to save the Surface to any possible file format and even make it possible to pass some additional information in the OutputSettings. (Except reducing the colors, there are no other settings yet)

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2376 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-12-11 14:36:20 +00:00
commit 5541e2e1c7
27 changed files with 191 additions and 290 deletions

View file

@ -41,7 +41,7 @@ namespace GreenshotPicasaPlugin {
/// </summary>
/// <param name="imageData">byte[] with image data</param>
/// <returns>PicasaResponse</returns>
public static string UploadToPicasa(Image imageToUpload, OutputSettings outputSettings, string title, string filename) {
public static string UploadToPicasa(ISurface surfaceToUpload, OutputSettings outputSettings, string title, string filename) {
OAuthSession oAuth = new OAuthSession(PicasaCredentials.ConsumerKey, PicasaCredentials.ConsumerSecret);
oAuth.BrowserSize = new Size(1020, 590);
oAuth.AccessTokenUrl = "https://www.google.com/accounts/OAuthGetAccessToken";
@ -67,7 +67,7 @@ namespace GreenshotPicasaPlugin {
try {
IDictionary<string, string> headers = new Dictionary<string, string>();
headers.Add("slug", OAuthSession.UrlEncode3986(filename));
string response = oAuth.MakeOAuthRequest(HTTPMethod.POST, "https://picasaweb.google.com/data/feed/api/user/default/albumid/default", headers, null, null, new ImageContainer(imageToUpload, outputSettings, filename));
string response = oAuth.MakeOAuthRequest(HTTPMethod.POST, "https://picasaweb.google.com/data/feed/api/user/default/albumid/default", headers, null, null, new SurfaceContainer(surfaceToUpload, outputSettings, filename));
return ParseResponse(response);
} catch (Exception ex) {
LOG.Error("Upload error: ", ex);