move/click/remove a graphics object

9 vues
Accéder directement au premier message non lu

Maria

non lue,
24 juin 2003, 16:15:0324/06/2003
à
Hello !

After some advice on this newsgroup I was able to draw a rectangle on a
panel with this code :

Public Sub MyPaint(ByVal sender As Object, ByVal e As PaintEventArgs)
Handles GfxPanel.Paint

Dim myPen As New Pen(Color.Red, 3)

Dim myGraphics = e.Graphics

myGraphics.DrawRectangle(myPen, 100, 100, 50, 50)

End Sub

Can someone guide me in the right direction when it comes to move/remove and
"mouseclick" such a graphic object ??

Sorry for my bad english !!

Thanks !!!

Maria

Paul Hetherington

non lue,
25 juin 2003, 11:07:4625/06/2003
à
To 'remove' the object just repaint the panel without the call to
e.DrawRectangle(*)


Bob Powell [MVP]

non lue,
26 juin 2003, 11:01:2126/06/2003
à
GDI+ is an immediate mode graphics system. Objects that you draw on screen
do not have any underlying structure aside from that which you explicitly
provide.

To perform the tasks you require you need to create a set of classes that
describe the objects on screen, store them in some sort of collection, draw
them in the OnPaint cycle and hit-test them in the various mouse events
thereby creating a retained mode graphics system.

To illustrate how to do this I have put an article in the GDI+ FAQ with
code.

--
Bob Powell [MVP]
C#, System.Drawing

Check out the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Buy quality Windows Forms tools
http://www.bobpowell.net/xray_tools.htm

Get the NEW must-have UI component. The .NET RectTracker
Enables CRectTracker like functionality for WindowsForms.
User defined layouts are a breeze.
http://www.bobpowell.net/recttracker.htm

"Maria" <mar...@INGENSPAMstart.no> wrote in message
news:#JWvrToO...@tk2msftngp13.phx.gbl...

Jake VanNoy

non lue,
27 juin 2003, 09:08:0927/06/2003
à
> Can someone guide me in the right direction when it comes to move/remove
and
> "mouseclick" such a graphic object ??

You may want to check out GoDiagram for .NET.
It gives you the support you need for clicking, dragging, resizing and a lot
more.

http://www.nwoods.com/go/dotnet.htm

Jake


Maria

non lue,
27 juin 2003, 15:30:1427/06/2003
à
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:#M62AP$ODHA...@TK2MSFTNGP10.phx.gbl...

> GDI+ is an immediate mode graphics system. Objects that you draw on screen
> do not have any underlying structure aside from that which you explicitly
> provide.
>
> To perform the tasks you require you need to create a set of classes that
> describe the objects on screen, store them in some sort of collection,
draw
> them in the OnPaint cycle and hit-test them in the various mouse events
> thereby creating a retained mode graphics system.
>
> To illustrate how to do this I have put an article in the GDI+ FAQ with
> code.


Thank you !

I will take a look at the FAQ

Regards
Maria


Maria

non lue,
27 juin 2003, 15:29:3027/06/2003
à
> You may want to check out GoDiagram for .NET.
> It gives you the support you need for clicking, dragging, resizing and a
lot
> more.
>

Thanks !

It looks interesting - but unfortunately I'm on a budget...

Regards
Maria


Andrew Moore

non lue,
27 juin 2003, 16:44:5027/06/2003
à
Maria,

Also, try this link out. This explains scrolling, rotating, zooming and hit
testing with the mouse.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/ht
ml/designsurface.asp

"Maria" <mar...@INGENSPAMstart.no> wrote in message

news:ufbxMoNP...@TK2MSFTNGP11.phx.gbl...

Maria

non lue,
27 juin 2003, 17:21:1827/06/2003
à

"Andrew Moore" <amo...@systemflow.com> wrote in message
news:612La.253874$VP.50...@twister.neo.rr.com...

> Maria,
>
> Also, try this link out. This explains scrolling, rotating, zooming and
hit
> testing with the mouse.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/ht
> ml/designsurface.asp
>

Thank you !

Maria


Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message