Graphics Question
-
Hi Everyone: I'm trying to teach myself VB 2005 .NET and the best way I have found to learn something is to make a project in the language I wish to learn. I'm playing with a graphics Windows application. I want to draw a simple graphics shape(rectangle, circle, line, etc) on a windows form and be able to move that graphics object anywhere on the form using the mouse. Does anyone have any sample code that can draw a shape on the windows form and allow to move it with the mouse, or arrow keys? Thanks in advance, Quecumber256
-
Hi Everyone: I'm trying to teach myself VB 2005 .NET and the best way I have found to learn something is to make a project in the language I wish to learn. I'm playing with a graphics Windows application. I want to draw a simple graphics shape(rectangle, circle, line, etc) on a windows form and be able to move that graphics object anywhere on the form using the mouse. Does anyone have any sample code that can draw a shape on the windows form and allow to move it with the mouse, or arrow keys? Thanks in advance, Quecumber256
-
Hi Everyone: I'm trying to teach myself VB 2005 .NET and the best way I have found to learn something is to make a project in the language I wish to learn. I'm playing with a graphics Windows application. I want to draw a simple graphics shape(rectangle, circle, line, etc) on a windows form and be able to move that graphics object anywhere on the form using the mouse. Does anyone have any sample code that can draw a shape on the windows form and allow to move it with the mouse, or arrow keys? Thanks in advance, Quecumber256
There are no built-in classes to do this, not is there any support built into GDI for this either. What you're referring to is a "retained mode" graphics system. This is something that you either have to write yourself (WARNING! NOT for someone who has little experience!), or use a third party library to handle it for you, like VG.NET.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
There are no built-in classes to do this, not is there any support built into GDI for this either. What you're referring to is a "retained mode" graphics system. This is something that you either have to write yourself (WARNING! NOT for someone who has little experience!), or use a third party library to handle it for you, like VG.NET.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Dave: Thank you. I have had some discussions with our .NET developer here at the office and he put some things in perspective for me. For example: I drew a square on the windows form. That would be level 1. Next I drew a circle on top of the square, this is level 2. So if I click on the circle I have to have some routine that looks at the levels and sees where the cursor is pointing, which level it is on, and then place some kind of "visual handlers" around the object then use another routine to move it on the form. This helps me grasp the concept of what I'm trying to accomplish. Do you have any recommendations for books that cover graphics manipulation and programming for VB .NET? Thank you, Quecumber256