public ActionResult GetChargeVoucherImage([FromRoute] int id, [FromQuery] string operationCode) { var url = _urlManager.GetChargeVoucherHtmlUrl(id, operationCode); var image = UrlToImage.DownloadContentAsImage(url); return(File(image, "image/jpeg")); }
public async Task <IActionResult> ToImage(string url = "/Home/Index") { url = string.Format("{0}://{1}{2}", HttpContext.Request.Scheme, HttpContext.Request.Host, url); var image = new UrlToImage(url); await image.SaveFileAsync(Path.Combine("wwwroot/files/image", DateTime.Now.ToString("yyyyMMddhhmmss") + ".png")); return(Content("ok")); }
public override int GetHashCode() { unchecked { int hashCode = (Source != null ? Source.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Author != null ? Author.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Url != null ? Url.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (UrlToImage != null ? UrlToImage.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PublishedAt.GetHashCode(); return(hashCode); } }
/// <summary> /// This endpoint lets you to convert any publicly accessible URL into an Image. /// </summary> /// <param name="urlToImageParams">Url to Image parameters.</param> /// <returns>Returns a ReturnResponse type</returns> public Task <ReturnResponse> UrlToImage(UrlToImage urlToImageParams) { return(SendRequest(urlToImageParams)); }
public void Path_IsCorrect() { var urlToImage = new UrlToImage(); Assert.AreEqual("url/image", urlToImage.Path); }