.NET Framework - Moveable Graphic Object? tutorials
Asked By Bob S
18-Mar-10 04:52 PM

I am looking at a project which will require me to venture into some
new territory. I have been searching the net and appear to have not
hit on the correct keywords to find what I am looking for.
I need to write an application which draws objects on a canvas, but I need
the objects to remain objects so they could be moved around. Basically the
same sort of functionality found in Visual Studio Design mode where I can
pull a button out of the toolbox and after it has been placed, move it to
somewhere else.
Looking at the generated code, I see how buttons are created and positioned
and I suppose that trapping mouse down on the button and then looking at
motion events could allow me to move the object around. I suspect that there
is
support for doing that somewhere, but I have not found the correct set of
keywords to hit on it. Most of the stuff I have found on GDI objects and
graphics objects have dealt which drawing things on a canvas and then
Any pointers on where to look would be appreciated.
If I have not provided enough detail on what I am attempting to accomplish,
this application will be simliar to a gant chart program. The data objects
will
be generated from data with size being related to duration and coloration
being
related to the type of activity. These objects will be moved to one or more
timelines. Assorted cross checking will be done when the object is placed.
Snap to grid type granularity would also be nice.
Thank you for your time.
--
Robert E. Styma
Principal Engineer (DMTS)
Alcatel-Lucent, Phoenix
Visual Studio
(1)
WPF
(1)
Graphics.htmChris
(1)
Alcatel
(1)
Phoenix
(1)
Styma
(1)
Granularity
(1)
Graphics
(1)
OmegaSquared replied to Bob S
Hello, Bob,
I do not know about a tutorial for doing this, but when I had a somewhat
similar requirement I created custom controls for the movable objects and
placed them on a windows form (that I called a "drawing"). Then moving them
around was "just" a question of using/handling the standard Windows
click-and-drag methods. (I also added the capability to move the objects
with the keyboard. Again, just handling the keyboard events was "all" that
was required.)
(I have added the quotes, because "just" and "all" turned out to be a fair bit
of effort in itself. Maybe there are third-party tools that would make the
whole thing easier, but my constraints prevented use of third-part tools and
controls, so I did not research this possibility.)
Cheers,
Randy
Jarek Mielcarek replied to Bob S
W dniu 2010-03-18 21:52, Bob S pisze:
Try this:
http://www.codeproject.com/KB/miscctrl/TheoryOfMoveableObjects.aspx
Jarek
Andrew Morton replied to Bob S
The keyword you are looking for is probably "sprites":
http://www.google.com/#hl=en&source=hp&q=vb.net+sprites
Andrew
Chris Dunaway replied to Bob S
Try this:
http://www.bobpowell.net/manipulate_graphics.htm
Chris
Tom Shelton replied to Bob S
Chris pointed you to an article that explained a bit about creating your own
retained mode graphics system around GDI/GDI+.
Might I point out though, that WPF already is a retained mode graphics system?
Hittesting, etc, etc, already built in... Just another alternative.
--
Tom Shelton
bei jedem neustart, was ist da faul ? Danke für Hinweise Karsten Schulz VC - German Discussions Visual Studio 2008 (1) Visual Studio (1) Office (1) CorrectSpellT (1) SPMicrosoft (1) Directories (1) Heritage® (1) Houghton (1) Hallo Karsten of Programming FAQ: http: / / www.mpdvc.de Samples: http: / / www.codeproject.com Hi Martin, Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1 Installed Edition: Enterprise Microsoft Visual Basic 2008 91899-270-6248762-60410 Microsoft Visual Basic 2008 Microsoft Visual C# 2008 91899-270-6248762-60410 Microsoft Visual C# 2008 Microsoft
IDEs, etc do they use? What language? I code in C#, have done Windows Forms, WPF, Silverlight, ADO.NET, ASP.NET and some VB and Access dB programming, though I prefer now (SOAP) web services using REST as well. All of course under the award winning Visual Studio IDE. I am using VS 2008 but might upgrade to VS 2010. Seriously, why would Why would anybody use an IDE that does not have the bells and whistles of Visual Studio, like Intellisense? What's the point of not having a decent IDE? The only thing that uses Windows OS. But again, you can port (I think) almost anything done in Visual Studio to Linux. Please educate me, I am at a loss. I would even argue perhaps generic list, array, etc, or do you have to build your own? RL C# Discussions Visual Studio 2008 (1) Visual Studio 2005 (1) Visual Studio (1) Silverlight (1) Python (1) Linux
If you still find the GDI is slow to your need, maybe a migrate to WPF? Thank for your reply No speed increment, with code correction, i think that compiler optimization obtain the max speed of execution What mean, by code point of view, migrate to Wpf ? RobertoA it is a long time since I have done Windows graphics, but: Assuming you and maybe a complete-but-consice code example would help others point out the problem. WPF is a new API for developing a windows application in which the rendering is accelarated optimization you could and you feel it is the limit of GDI, then moving to WPF might help. For what it is worth, I am not aware of any research that suggests that WPF's advantages lie in the area of performance. In fact, a number of sources indicate that at least for simple graphics, WPF is significantly slower, due to its more complex layout engine. Remember: while WPF is using 3D hardware acceleration for rendering, GDI+ does use hardware acceleration as well, just is actually spent in the rendering itself. There are certain kinds of rendering for which WPF is well-suited, especially in the area of animation and transformations, but for just drawing
next = null; } public SinglyLinkedListNode(T data, SinglyLinkedListNode<T> tail) { this.data = data; next = tail; } } Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1 Installed 2008 91851-136-3759112-60601 Microsoft Silverlight Projects 2008 Version 9.0.30730.126 Microsoft Visual Basic 2008 91851-136-3759112-60601 Microsoft Visual Basic 2008 Microsoft Visual C# 2008 91851-136-3759112-60601 Microsoft Visual C# 2008 Microsoft Visual C++ 2008 91851-136-3759112-60601 Microsoft Visual C++ 2008 Microsoft Visual Web Developer 2008 91851-136-3759112-60601 Microsoft Visual Web Developer
dll' or one of its dependencies. The specified module could not be found Note that visual studio 2010 is only installed on my windows 7 but the 4.0 framework runtimes is and only on xp I really need help Thanks mike C# Discussions Windows XP (1) Visual Studio (1) Windows 7 (1) Module (1) FIND (1) Kill (1) Bit (1) XP (1) Just 4.0 specific thing So for you the only thing to do is to install Visual studio 2010 (not wanted) on that winxp machine to debug it. I am currently creating a does not preclude a problem with your DLL, or one of its dependencies. Assuming the Visual Studio debugger will help (for DLL loading problems, it often will not), you only need to