Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP.NET (http://www.programmingforums.org/forum35.html)
-   -   Drawing shapes (http://www.programmingforums.org/showthread.php?t=14775)

venkatramasamy Dec 19th, 2007 10:22 PM

Drawing shapes
 
Hi,

I am trying to develop an drawing board,like MSpaint,

I use the follwing code to draw an circle while cliking a button

:

Protected Sub BtnCircle_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnCircle.Click
        DrwTool = "Circle"
        objGraphics = System.Drawing.Graphics.FromImage(objBitmap)
        objGraphics.Clear(Drawing.Color.White)

        'Code to Draw Circle
        Dim r As New Drawing.Pen(Drawing.Color.Black, 5)
        Dim rect As New Drawing.Rectangle(300, 10, 280, 280)
        objGraphics.DrawEllipse(r, rect)
        Dim b1 As New Drawing.SolidBrush(Drawing.Color.BurlyWood)
        'objGraphics.FillEllipse(b1, rect)
        objGraphics.DrawArc(Drawing.Pens.DarkBlue, 50, 50, 100, 100, 0, 180)
        objGraphics.DrawArc(Drawing.Pens.DarkBlue, 50, 50, 100, 100, 180, 180)
        'objGraphics.FillEllipse(Drawing.Brushes.White, 30, 60, 280, 280)


        'objBitmap.Save(Server.MapPath("x.jpg"), Drawing.Imaging.ImageFormat.Jpeg)
        objBitmap.Save(Response.OutputStream, Drawing.Imaging.ImageFormat.Gif)


        objBitmap.Dispose()
        objGraphics.Dispose()
    End Sub


the code draws the circle,but the problem there with is..all other control went disappear(The whole page only drawn with a single circle)

is anybody there to help me how to override this,
my exact need is draw the objects on mouse event(similarly like MSpaint)

Thanks in advance

Venkatramasamy SN


All times are GMT -5. The time now is 12:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC