| | |
simple paint similar to MS Paint.. I have qustions!
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 4
Reputation:
Solved Threads: 0
Hi,
I work with Microsoft Visual Studio 2005.
I'm about to build a simple paint editor similar to MS Paint program.
of course, it has Edit menu, with Undo, Redo, Cut, Copy, Paste, Delete... etc.
I have a problem with Undo and Redo!
How to do them with drawing?
have I use Stack or something like this?
I'm just a beginner and I have no idea
Another question..
For Cut, Paste, Copy and Delete, I need a selection tool same as the one in MS Paint.
Where can I find it? or how to Cut and Paste with out it?
Please, I really need your help
thanx a lot.
I work with Microsoft Visual Studio 2005.
I'm about to build a simple paint editor similar to MS Paint program.
of course, it has Edit menu, with Undo, Redo, Cut, Copy, Paste, Delete... etc.
I have a problem with Undo and Redo!
How to do them with drawing?
have I use Stack or something like this?
I'm just a beginner and I have no idea
Another question..
For Cut, Paste, Copy and Delete, I need a selection tool same as the one in MS Paint.
Where can I find it? or how to Cut and Paste with out it?
Please, I really need your help

thanx a lot.
Last edited by Nana.vb; Apr 26th, 2007 at 9:05 am.
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
Here is how I did a undo:
To save a bitmap:
To undo:
The second part I am going to have to find. I'll get back at you.
VB.NET Syntax (Toggle Plain Text)
Dim UndoStack As New Stack(Of Bitmap)() 'holds the backup images '========================================================================== ' Saves the picture passed '========================================================================== Private Sub PushUndo(ByVal b As Bitmap) UndoStack.Push(b) btnUnDo.Visible = True End Sub '========================================================================== ' Returns the last picture saved '========================================================================== Private Function PopUndo() As Bitmap If UndoStack.Count = 0 Then Return Nothing btnUnDo.Visible = False Exit Function End If If UndoStack.Count = 1 Then btnUnDo.Visible = False Return UndoStack.Pop End Function
VB.NET Syntax (Toggle Plain Text)
'save the current picture for undo PushUndo(Display.Image.Clone)
VB.NET Syntax (Toggle Plain Text)
'========================================================================== ' pops the last bitmat off the stack and places it in the display '========================================================================== Private Sub btnUnDo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUnDo.Click Dim bmp As Bitmap bmp = PopUndo() If bmp IsNot Nothing Then Display.Image = bmp End If End Sub
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
After all this time I finally found my bug in this routine. The undo button would never go off and I couldn't figure out why. Can you see it?
In vb net a return exits the routine immediatlly so in the above btnUnDo.visible=False never got executed and neither did Exit Function. Because it was exiting I figured it was working right. Now I know why not.
It should be:
VB.NET Syntax (Toggle Plain Text)
If UndoStack.Count = 0 Then Return Nothing btnUnDo.Visible = False Exit Function End If
It should be:
VB.NET Syntax (Toggle Plain Text)
If UndoStack.Count = 0 Then btnUnDo.Visible = False Return Nothing End If
•
•
Join Date: Apr 2007
Posts: 4
Reputation:
Solved Threads: 0
waynespangler..
ohhh .. yes that's right : )
thanx alooot
jbennet..
The drawing tool bar contains:
thank u : )
ohhh .. yes that's right : )
thanx alooot
jbennet..
The drawing tool bar contains:
- Lines (in different styles : regular, dashed and thick)
- curves
- Shapes: rectangle, circle and oval.
- Pen.
- Brush ( in different styles- HatchBrush, LinearGradientBrush, PathGradientBrush and TextureBrush)
- Text.
- Fill (with color or pattern)
thank u : )
Last edited by Nana.vb; Apr 27th, 2007 at 12:06 pm.
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Plz resend the reply........
- Next Thread: Searching multiple MS SQL Tables
| Thread Tools | Search this Thread |
.net .net2008 2008 access account add advanced application array basic beginner browser button buttons click code combo cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic employees excel exists fade filter forms generatetags html images input intel internet listview mobile module monitor mysql net number objects open panel pdf picturebox picturebox2 port position print printing printpreview problem regex reuse right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver storedprocedure survey temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet vista visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year







