Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 19th, 2007, 10:22 PM   #1
venkatramasamy
Newbie
 
Join Date: Oct 2007
Location: INDIA
Posts: 19
Rep Power: 0 venkatramasamy is an unknown quantity at this point
Send a message via AIM to venkatramasamy
Post 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
venkatramasamy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing in console (UNIX) Wizard1988 C 2 Nov 15th, 2007 1:06 PM
Drawing Trees in with Swing hoffmandirt Java 1 Feb 22nd, 2007 3:36 PM
Drawing To ImageList HackeZ Visual Basic 0 Dec 19th, 2005 12:17 PM
Keep Drawing Pixels without previous ones cleared. JavaMan Java 4 Oct 27th, 2005 7:43 PM
Drawing using vectors HeX Java 12 May 7th, 2005 10:25 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:32 AM.

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