I am using the following code to generate a semi-ellipse. I want to cut-off the portion below the semi-ellipse and return only the semi-ellipse. Any pointers or path forward will be highly appreciated.
Code:
Int32 Radius = 100; Int32 X_Coordinate_upper_left_corner = 0; Int32 Y_Coordinate_upper_left_corner = 0; Int32 Width = 2 * Radius; Int32 Height = Radius; Bitmap objBitmpCanvas = new Bitmap(Width, Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); Graphics objGraphics = Graphics.FromImage(objBitmpCanvas); Pen objPen = new Pen(Color.Black, 2); objGraphics.Clear(Color.White); Rectangle objRectangle = new Rectangle(X_Coordinate_upper_left_corner, Y_Coordinate_upper_left_corner, Width, Height); objGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; objGraphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; objGraphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; objGraphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; objGraphics.DrawArc(objPen, objRectangle, 0, 180); Response.ContentType = "image/gif"; objBitmpCanvas.Save(Response.OutputStream, ImageFormat.Gif);
Comment