public async Task RotateAsync(DegreesEnum degrees, FlipEnum flip) { string flipValue = flip.GetEnumMemberValue(); string degreesValue = degrees.GetEnumMemberValue(); var postProperties = new List <KeyValuePair <string, object> >(); postProperties.Add(new KeyValuePair <string, object>("Degrees", degreesValue)); postProperties.Add(new KeyValuePair <string, object>("Flip", flipValue)); var payload = JsonHelpers.GetPayloadAsJson(postProperties); // /image/(*)!rotate string requestUri = string.Format("{0}/image/{1}!rotate", SmugMug.v2.Constants.Addresses.SmugMugApi, ImageKey); await PostRequestAsync <object>(requestUri, payload); }
/// <summary> /// Rotates an image /// </summary> /// <param name="de">The degrees of rotation. Left=90, Down=180, Right=270</param> /// <param name="Flip">If true, mirror the image in the horizontal direction</param> /// <returns>bool</returns> public bool Rotate(DegreesEnum de, bool Flip) { CommunicationHelper ch = new CommunicationHelper(); // SessionID [required], ImageId [required], Degrees [required], Flip [required], Callback, Pretty, Strict var resp = ch.ExecuteMethod<ImageResponse>("smugmug.images.rotate", basic, "ImageID", id, "Degrees", (int)de, "Flip", Flip); if (resp.stat == "ok") return true; else { Console.WriteLine(resp.message); throw new SmugMugException(resp.code, resp.message, resp.method); } }
/// <summary> /// Rotates an image /// </summary> /// <param name="de">The degrees of rotation. Left=90, Down=180, Right=270</param> /// <returns>bool</returns> public async Task<bool> RotateAsync(DegreesEnum de) { return await RotateAsync(de, false); }
/// <summary> /// Rotates an image /// </summary> /// <param name="de">The degrees of rotation. Left=90, Down=180, Right=270</param> /// <returns>bool</returns> public bool Rotate(DegreesEnum de) { return Rotate(de, false); }
/// <summary> /// Rotates an image /// </summary> /// <param name="de">The degrees of rotation. Left=90, Down=180, Right=270</param> /// <param name="Flip">If true, mirror the image in the horizontal direction</param> /// <returns>bool</returns> public bool Rotate(DegreesEnum de, bool Flip) { return RotateAsync(de, Flip).Result; }