How to rotate a image in ASP.NET

VB.NET Dim img As System.Drawing.Image Dim strFilename As String = Server.MapPath(‘curves1.jpg’) img = System.Drawing.Image.FromFile(strFilename) Dim b = New System.Drawing.Bitmap(img.Width, img.Height, PixelFormat.Format24bppRgb) Dim g As Graphics = Graphics.FromImage(b) img.RotateFlip(System.Drawing.RotateFlipType.Rotate270FlipXY) g.DrawImage(img, New Point(0, 0)) Response.ContentType = ‘image/jpeg’ b.Save(Response.OutputStream, ImageFormat.Jpeg) C# System.Drawing.Image img ; string strFilename = Server.MapPath(‘curves1.jpg’) ; img = System.Drawing.Image.FromFile(strFilename) ; Bitmap b = new System.Drawing.Bitmap(img.Width, img.Height, PixelFormat.Format24bppRgb) ; Graphics g = Graphics.FromImage(b) ; img.RotateFlip(System.Drawing.RotateFlipType.Rotate270FlipXY) ; g.DrawImage(img,new Point(0,0)) ; Response.ContentType=’image/jpeg’ ; b.Save(Response.OutputStream, ImageFormat.Jpeg) ;

How to display image on a browser without using the image tag

VB.NET Dim objBitmap As New Bitmap(500, 500) Dim objGraphics As Graphics = Graphics.FromImage(objBitmap) objGraphics.Clear(Color.White) objGraphics.FillRectangle(New SolidBrush(Color.Purple), 0, 0, 400, 10) objBitmap.Save(Response.OutputStream, ImageFormat.Jpeg) C# Bitmap objBitmap = new Bitmap(500, 500); Graphics objGraphics = Graphics.FromImage(objBitmap); objGraphics.Clear(Color.White); objGraphics.FillRectangle(new SolidBrush(Color.Purple ), 0, 0, 400, 10); objBitmap.Save(Response.OutputStream, ImageFormat.Jpeg);