void Download_Click(object sender, EventArgs e) { string templateFilename = this.Server.MapPath("./Poster-Templates/map-example-template.jpg"); PosterDesigns.ExampleMap poster = new PosterDesigns.ExampleMap(templateFilename); poster.Frequency = Frequency.Text; poster.Venue = Venue.Text; poster.SignUpLink = string.Format("http://toepoke.co.uk/{0}.aspx", this.EventID.Text); poster.ShowGuides = false; poster.ShowDimensions = false; poster.PercentSize = 100; // fullSize when downloading poster.VenueMap.Type(this.MapType.SelectedValue); if (!string.IsNullOrEmpty(this.LatLong.Text)) { poster.VenueMap.Centre(this.LatLong.Text); } else { poster.VenueMap.Centre(this.Address.Text); } PosterBuilder.ImgFormat.SupportedTypes imgType = PosterBuilder.ImgFormat.FromString(PosterRendering.ImageTypes.SelectedValue); Helpers.SendPosterToBrowser(poster, this.Response, "my-poster", imgType); } // Download_Click
/// <summary> /// Responsible for drawing (and downloading) the map example poster. /// </summary> protected void RenderMapPosterExample(HttpContext ctx) { string templateFilename = ctx.Server.MapPath("./Poster-Templates/map-example-template.jpg"); string when = GetParm(ctx, "when"); string where = GetParm(ctx, "where"); string id = GetParm(ctx, "eventId"); string latLong = GetParm(ctx, "lat-long"); string address = GetParm(ctx, "address"); string mapType = GetParm(ctx, "map-type"); // And build the poster and send the response back to the browser PosterDesigns.ExampleMap mapPoster = new PosterDesigns.ExampleMap(templateFilename); string url = string.Format("http://toepoke.co.uk/{0}.aspx", id); // Set the dynamic bits mapPoster.Frequency = when; mapPoster.Venue = where; mapPoster.SignUpLink = url; mapPoster.VenueMap .Type( mapType ) ; if (!string.IsNullOrEmpty(latLong)) // use the Lan/Long in preference to the address (better accuracy) mapPoster.VenueMap.Centre(latLong); else mapPoster.VenueMap.Centre(address); // Show a border around the areas defined (helps debugging where the rectangles should go) mapPoster.ShowGuides = GetShowGuidesParam(ctx); mapPoster.ShowDimensions = GetShowGuidesParam(ctx); // Set the size we're after mapPoster.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(mapPoster, ctx.Response, "football-poster", outFmt); }
} // RenderTextPosterExample /// <summary> /// Responsible for drawing (and downloading) the map example poster. /// </summary> protected void RenderMapPosterExample(HttpContext ctx) { string templateFilename = ctx.Server.MapPath("./Poster-Templates/map-example-template.jpg"); string when = GetParm(ctx, "when"); string where = GetParm(ctx, "where"); string id = GetParm(ctx, "eventId"); string latLong = GetParm(ctx, "lat-long"); string address = GetParm(ctx, "address"); string mapType = GetParm(ctx, "map-type"); // And build the poster and send the response back to the browser PosterDesigns.ExampleMap mapPoster = new PosterDesigns.ExampleMap(templateFilename); string url = string.Format("http://toepoke.co.uk/{0}.aspx", id); // Set the dynamic bits mapPoster.Frequency = when; mapPoster.Venue = where; mapPoster.SignUpLink = url; mapPoster.VenueMap .Type( mapType ) ; if (!string.IsNullOrEmpty(latLong)) // use the Lan/Long in preference to the address (better accuracy) mapPoster.VenueMap.Centre(latLong); else mapPoster.VenueMap.Centre(address); // Show a border around the areas defined (helps debugging where the rectangles should go) mapPoster.ShowGuides = GetShowGuidesParam(ctx); mapPoster.ShowDimensions = GetShowGuidesParam(ctx); // Set the size we're after mapPoster.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(mapPoster, ctx.Response, "football-poster", outFmt); } // RenderMapPosterExample
void Download_Click(object sender, EventArgs e) { string templateFilename = this.Server.MapPath("./Poster-Templates/map-example-template.jpg"); PosterDesigns.ExampleMap poster = new PosterDesigns.ExampleMap(templateFilename); poster.Frequency = Frequency.Text; poster.Venue = Venue.Text; poster.SignUpLink = string.Format("http://toepoke.co.uk/{0}.aspx", this.EventID.Text); poster.ShowGuides = false; poster.ShowDimensions = false; poster.PercentSize = 100; // fullSize when downloading poster.VenueMap.Type( this.MapType.SelectedValue ); if (!string.IsNullOrEmpty(this.LatLong.Text)) poster.VenueMap.Centre( this.LatLong.Text ); else poster.VenueMap.Centre( this.Address.Text ); PosterBuilder.ImgFormat.SupportedTypes imgType = PosterBuilder.ImgFormat.FromString(PosterRendering.ImageTypes.SelectedValue); Helpers.SendPosterToBrowser(poster, this.Response, "my-poster", imgType); }