Streaming a PNG file into Response.OutputStream?

Posted by: Rick Strahls WebLog, on 14 Jun 2006 | View original

Hmmm… I’m working on an HTTP handler that is returning an image as its end result. The image generation works fine and a generic routine returns a Bitmap image as a result. Finally I write out the image like this:   Bitmap bmp = wwWebUtils.CornerImage(backcolor, color, c, Radius, Height, Width);   // *** Works: //bmp.Save(@"c:\projects2005\wwStore\corner.png", ImageFormat.Png);         // *** Doesn’t work Response.ContentType = "image/png"; bmp.Save(Response.OutputStream,ImageFormat.Png);   This...

Advertisement
The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.

Similar Posts

  • Accessing Embedded Resources through a URL using WebResource.axd more
  • Common Gotcha: Slow VS 2005 Web Site Build Performance Because of Dueling Assembly References more
  • [SQL] Scripting backup and restore all databases on a server (Part 2 - Extra Credit) more
  • Gridview Export to Excel more
  • Templates - Part 1 more
  • Getting list of files sorted by date more
  • SharePoint 2003 Doc Libraries and Icons more
  • Moving lots of data more
  • You gotta love the little things in .NET Framework 2.0: File.ReadAllLines() more
  • Test-driving Windows shell scripts with Windows Scripting Host more

News Categories

.NET | ADO.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Community Server | dasBlog | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD