Computer Graphics

Moderators: Sephiroth
Number of threads: 1241
Number of posts: 2641

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
What component to use for drawing graphics in Visual Studio 2005 Posted by Denny_B on 18 Nov 2008 at 2:21 PM
Hi,
I am new to Visual Studio and I need to make an application with graphics (mostly lines and arcs). My question is what component you use for drawing graphics (like in Borland Builder is TPaintBox component). To be more specific, which component you use to take the device content from in Visual Studio.
Thank you,
Denny_B
/*edited*/ The application will be dialog based.
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by suhardi85 on 30 Dec 2008 at 9:23 PM
Picturebox

: Hi,
: I am new to Visual Studio and I need to make an application with
: graphics (mostly lines and arcs). My question is what component you
: use for drawing graphics (like in Borland Builder is TPaintBox
: component). To be more specific, which component you use to take the
: device content from in Visual Studio.
: Thank you,
: Denny_B
: /*edited*/ The application will be dialog based.

Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Sephiroth on 1 Jan 2009 at 11:56 PM
: Picturebox
:
: : Hi,
: : I am new to Visual Studio and I need to make an application with
: : graphics (mostly lines and arcs). My question is what component you
: : use for drawing graphics (like in Borland Builder is TPaintBox
: : component). To be more specific, which component you use to take the
: : device content from in Visual Studio.
: : Thank you,
: : Denny_B
: : /*edited*/ The application will be dialog based.
:
:
Is this a .NET project?
-Sephiroth
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Denny_B on 2 Jan 2009 at 12:30 AM
: : Picturebox
: :
: : : Hi,
: : : I am new to Visual Studio and I need to make an application with
: : : graphics (mostly lines and arcs). My question is what component you
: : : use for drawing graphics (like in Borland Builder is TPaintBox
: : : component). To be more specific, which component you use to take the
: : : device content from in Visual Studio.
: : : Thank you,
: : : Denny_B
: : : /*edited*/ The application will be dialog based.
: :
: :
: Is this a .NET project?
: -Seph[/gre
: en]iroth
:


No, the project is not .NET. It is a stand alone simple .exe project.
Is the Picturebox mentioned above Picture Control?
Thanks for your time and effort to help.
Denny_B

Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by suhardi85 on 3 Jan 2009 at 12:35 PM
: No, the project is not .NET. It is a stand alone simple .exe project.
: Is the Picturebox mentioned above Picture Control?
: Thanks for your time and effort to help.
: Denny_B
:
:

u want a simple program for drawing??
i'm making one program like paint, maybe i can give u when i've done.. ^^
i'm thought u just asking for the component for drawing image.
hehehe.....
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Denny_B on 4 Jan 2009 at 1:10 AM
: : No, the project is not .NET. It is a stand alone simple .exe project.
: : Is the Picturebox mentioned above Picture Control?
: : Thanks for your time and effort to help.
: : Denny_B
: :
: :
:
: u want a simple program for drawing??
: i'm making one program like paint, maybe i can give u when i've
: done.. ^^
: i'm thought u just asking for the component for drawing image.
: hehehe.....
:

Oh thanks,
I have the application writen already in Builder C++, but I am not really happy with some limitations of Builder C++ in graphics (using Canvas object for drawing), so I thought I would migrate to Visual C++, but it's hard for me to understand how everything works in Visual C++, user interface is killing me. I can't do simple things, which takes me seconds in Builder C++, I am locked in it.
The original question was what component should I use for drawing lines and arcs in Visual C++.
I have to decide which way to go,
Denny_B
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Daz_86 on 8 Jan 2009 at 9:11 AM
Are you after a GUI to draw with, or do you mean to draw programatically? If you need to draw programatically you can use the system.drawing namespace in .NET to perform drawing, draw arcs and lines etc.. you have to handle the OnPaint Event of a form or control in order to gain access to the "graphics" object which is sent in the event args of the event.. you can then use the graphics object programatically in the drawing!


Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Denny_B on 24 Jan 2009 at 5:10 PM
Thanks Daz, this is what I meant. You mentioned form or control. Which control is the best for drawing? I want to make a simple 2D editor, so the user can draw lines and arcs.
Regards,
Denny
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Daz_86 on 25 Jan 2009 at 5:42 PM
If you create a new "User Control" in your project, you can then add that control to any forms in your application, so its probably better to create a new user control to act as the "canvas" - i.e the actual thing that will be drawn on. You can then add the canvas / control to a windows form, and postion it on the form as needed, so its kept seperate from the form and that might be easier to work with from a UI perspective, rather than drawing directly on the form itself, but its entirely your choice of design.

As i mentioned before, you would then probably need to add some code to that user control to handle the OnPaint() event, and thats where you will have access to the Graphics obect, and thats the opportune moment to do any drawing thats required using the system.drawing namespace classes with the graphics object of the control.. Hope that helps.. ;)
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Daz_86 on 25 Jan 2009 at 6:00 PM
- oh and sorry to answer your question a bit better, there isnt really a standard control that you could use from the toolbox in .NET that would give you ie a "canvas" that a user could draw on. I suspect that you would need to start with a User Control as i mentioned in my pevious post, and then if you wanted the user to be able to draw on it, you could have to add code to it so that you could handle the relevant mouse events to work out when the user started and stopped drawing and then draw the relevent graphics.. you'd have to capture the x,y mouse coordinates to aid you in tht i guess..
Alternatively you could hunt around for a .NET control that someone else may have done that allready handles this kind of "canvas" functionality.. but thats cheating.
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by Denny_B on 25 Jan 2009 at 6:42 PM
Thanks Daz for your answers. This explains what I need as there is no standard control for drawing in Visual C++. I have the code to draw the stuff (lines and arcs) but it's in Borland Builder. I was thinking to write the program in Visual C++, but the learning curve if slow (as is my brain).
Thanks for your help, I apreciate it,
Denny_B
Report
Re: What component to use for drawing graphics in Visual Studio 2005 Posted by haileyjonathan on 20 Mar 2009 at 10:01 PM
Hi,
I am also new to Visual studio..
still i have a little bit of knowledge about these...
so, pls any one know briefly explain these..
Thank you

http://www.prodigyapex.com



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.