} // MakePoster_Click void Download_Click(object sender, EventArgs e) { string templateFilename = this.Server.MapPath("./Poster-Templates/voucher-example-template.jpg"); PosterDesigns.ExampleVoucher voucher = new PosterDesigns.ExampleVoucher(templateFilename); voucher.SpecialOffer = SpecialOffer.Text; voucher.OfferFor = OfferFor.Text; voucher.Birthday = DateTime.Parse(Birthday.Text); voucher.ShowGuides = false; voucher.ShowDimensions = false; voucher.PercentSize = 100; // fullSize when downloading PosterBuilder.ImgFormat.SupportedTypes imgType = PosterBuilder.ImgFormat.FromString(PosterRendering.ImageTypes.SelectedValue); Helpers.SendPosterToBrowser(voucher, this.Response, "my-voucher", imgType); } // Download_Click
void Download_Click(object sender, EventArgs e) { string templateFilename = this.Server.MapPath("./Poster-Templates/voucher-example-template.jpg"); PosterDesigns.ExampleVoucher voucher = new PosterDesigns.ExampleVoucher(templateFilename); voucher.SpecialOffer = SpecialOffer.Text; voucher.OfferFor = OfferFor.Text; voucher.Birthday = DateTime.Parse(Birthday.Text); voucher.ShowGuides = false; voucher.ShowDimensions = false; voucher.PercentSize = 100; // fullSize when downloading PosterBuilder.ImgFormat.SupportedTypes imgType = PosterBuilder.ImgFormat.FromString(PosterRendering.ImageTypes.SelectedValue); Helpers.SendPosterToBrowser(voucher, this.Response, "my-voucher", imgType); }
} // RenderMapPosterExample /// <summary> /// Responsible for drawing (and downloading) the example voucher. /// </summary> protected void RenderVoucherExample(HttpContext ctx) { string templateFilename = ctx.Server.MapPath("./Poster-Templates/voucher-example-template.jpg"); // and build the voucher PosterDesigns.ExampleVoucher voucher = new PosterDesigns.ExampleVoucher(templateFilename); // Set the dynamic bits voucher.SpecialOffer = GetParm(ctx, "special-offer"); voucher.OfferFor = GetParm(ctx, "offer-for"); voucher.Birthday = DateTime.Parse(GetParm(ctx, "birthday")); voucher.ShowGuides = GetShowGuidesParam(ctx); voucher.ShowDimensions = GetShowGuidesParam(ctx); voucher.PercentSize = GetSizeParam(ctx); // And send back to the browser // .. we're just going to hard-code PNG for the time being PosterBuilder.ImgFormat.SupportedTypes outFmt = GetImageType(ctx); Helpers.SendPosterToBrowser(voucher, ctx.Response, "your-voucher", outFmt); } // RenderVoucherExample
/// <summary> /// Responsible for drawing (and downloading) the example voucher. /// </summary> protected void RenderVoucherExample(HttpContext ctx) { string templateFilename = ctx.Server.MapPath("./Poster-Templates/voucher-example-template.jpg"); // and build the voucher PosterDesigns.ExampleVoucher voucher = new PosterDesigns.ExampleVoucher(templateFilename); // Set the dynamic bits voucher.SpecialOffer = GetParm(ctx, "special-offer"); voucher.OfferFor = GetParm(ctx, "offer-for"); voucher.Birthday = DateTime.Parse(GetParm(ctx, "birthday")); voucher.ShowGuides = GetShowGuidesParam(ctx); voucher.ShowDimensions = GetShowGuidesParam(ctx); voucher.PercentSize = GetSizeParam(ctx); // And send back to the browser // .. we're just going to hard-code PNG for the time being PosterBuilder.ImgFormat.SupportedTypes outFmt = GetImageType(ctx); Helpers.SendPosterToBrowser(voucher, ctx.Response, "your-voucher", outFmt); }