starting with graphics  
Author Message
VooDoo Chicken





PostPosted: Visual C# Language, starting with graphics Top

hi, i was trying to start with graphics, i tought it would be something like:

// form1 declared by default in project, then, somewhere else:

canvas_oranyothersimilarnamedeclaredinnetframework=form1.getcanvas();

newpen=graphics.pen(someatributes);

canvasetc.gotoxy(x, y);

canvas.lineto(otherx, othery, pen)

or something like that.

in the dafault documentation (visual express), i can not find any examples about things like that, i see only one example that may be related (how to draw a non rectangular button), but in this example:

1. i can not compile it by just copy paste, the 'click handler' is out of the braces of both clases, both form1 and public class 'mybuttonobject',

there are things like Graphics graphics = e.Graphics;

where the heck was declared 'e', what the heck is 'e'

i was looking at the .net library, there are some classes (or spaces ) called system.draw, how do you use them which is the graphics component of the form i was trying to make something similar in a new project, starting from zero (except from the code originated by the ide at the beggining), and wrote something like:

in form1: Graphics something; it gives an error saying that graphics is not declared or something like that, in the main function i said something like

something=form1. (...) and waited till the box with the possible options appeared, in the list of atributes and methods there was nothing that had a name that resembled a drawing component..

<ranting>if micro$oft is gonna copy what others do, at least dont complicate it more than it is, if you are gonna copy at least try to keep the good things of the original</ranting>

what i'm trying to do is something simple: if i click on a form and move the mouse over, it should paint a line trough the movement of the mouse

is there any good tutorial, or at least a complete example of something like this somewhere

tnx



Visual C#11  
 
 
CsharpNeophyte





PostPosted: Visual C# Language, starting with graphics Top

Try looking up "System.Drawing" or "System.Drawing Namespace" in the documentation or on Google for basic drawing commands.

"e" typically refers to an "event" object which is passed to the appropriate event handlers when an event is fired (such as a controls OnDraw event)

These websites might help

http://www.c-sharpcorner.com/2/gdi_plus.asp

http://www.csharphelp.com/archives/archive222.html


 
 
VooDoo Chicken





PostPosted: Visual C# Language, starting with graphics Top

hi, tnx!, that scribble app is what i was looking for, will check it out