RadioDld.RssServer.FeedImageContent C# (CSharp) Method

FeedImageContent() private method

private FeedImageContent ( HttpListenerContext context ) : void
context System.Net.HttpListenerContext
return void
        private void FeedImageContent(HttpListenerContext context)
        {
            context.Response.ContentType = "image/png";

            // Find the appropriate codec for saving the episode image as a png
            System.Drawing.Imaging.ImageCodecInfo pngCodec = null;

            foreach (System.Drawing.Imaging.ImageCodecInfo codec in System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders())
            {
                if (codec.MimeType == context.Response.ContentType)
                {
                    pngCodec = codec;
                    break;
                }
            }

            try
            {
                Properties.Resources.icon_main_img256.Save(context.Response.OutputStream, pngCodec, null);
            }
            catch (HttpListenerException)
            {
                // Don't worry about dropped connections etc.
            }
        }