Exemplo n.º 1
0
        public void Any(ImageWriteToResponse request)
        {
            using (var image = new Bitmap(100, 100))
            {
                using (var g = Graphics.FromImage(image))
                {
                    g.Clear(request.Format.ToImageColor());
                }

                base.Response.ContentType = request.Format.ToImageMimeType();
                image.Save(base.Response.OutputStream, request.Format.ToImageFormat());
                base.Response.Close();
            }
        }
Exemplo n.º 2
0
        public void Any(ImageWriteToResponse request)
        {
            using (var image = new Bitmap(100, 100))
            {
                using (var g = Graphics.FromImage(image))
                {
                    g.Clear(request.Format.ToImageColor());
                }

                base.Response.ContentType = request.Format.ToImageMimeType();
                image.Save(base.Response.OutputStream, request.Format.ToImageFormat());
                base.Response.Close();
            }
        }