473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Vectorial Drawing

Leo
Hi :

I search some articles explaining how to make a little VectorialDesign
application with simple shape like line circles etc ... in C#
thx !!!

~leo~
Nov 15 '05 #1
3 4507

"Leo" <lv*******@grimladiforum.com> wrote in message
news:3f**********************@news.free.fr...
Hi :

I search some articles explaining how to make a little VectorialDesign
application with simple shape like line circles etc ... in C#
thx !!!

~leo~


some examples from sdk:

class PlainForm : Form

{

protected override void OnPaint(PaintEventArgs e)

{

Pen myPen = new Pen(Color.Red, 3);

Graphics myGraphics = e.Graphics;

myGraphics.DrawLine(myPen, 20, 10, 200, 100);

}

}

then just create object of PlainForm :

PlainForm Frm = new PlainForm();

Frm.Show();

put the needed code into OnPaint

for drawing arcs use something like

myGraphics.DrawArc(myPen, 100, 50, 140, 70, 30, 180);

for rectangle

myGraphics.DrawRectangle(myPen, 20, 10, 100, 50);

for polygons

Point[] myPointArray =
{new Point(0, 0), new Point(50, 30), new Point(30, 60)};
myGraphics.DrawPolygon(myPen, myPointArray);

for images something like

Bitmap myBMP = new Bitmap("SpaceCadet.bmp");
Bitmap myGIF = new Bitmap("Soda.gif");
Bitmap myJPEG = new Bitmap("Mango.jpg");
Bitmap myPNG = new Bitmap("Flowers.png");
Bitmap myTIFF = new Bitmap("MS.tif");

myGraphics.DrawImage(myBMP, 10, 10);
myGraphics.DrawImage(myGIF, 220, 10);
myGraphics.DrawImage(myJPEG, 280, 10);
myGraphics.DrawImage(myPNG, 150, 200);
myGraphics.DrawImage(myTIFF, 300, 200);

Nov 15 '05 #2

"Leo" <lv*******@grimladiforum.com> wrote in message
news:3f**********************@news.free.fr...
Hi :

I search some articles explaining how to make a little VectorialDesign
application with simple shape like line circles etc ... in C#
thx !!!

~leo~


some examples from sdk:

class PlainForm : Form

{

protected override void OnPaint(PaintEventArgs e)

{

Pen myPen = new Pen(Color.Red, 3);

Graphics myGraphics = e.Graphics;

myGraphics.DrawLine(myPen, 20, 10, 200, 100);

}

}

then just create object of PlainForm :

PlainForm Frm = new PlainForm();

Frm.Show();

put the needed code into OnPaint

for drawing arcs use something like

myGraphics.DrawArc(myPen, 100, 50, 140, 70, 30, 180);

for rectangle

myGraphics.DrawRectangle(myPen, 20, 10, 100, 50);

for polygons

Point[] myPointArray =
{new Point(0, 0), new Point(50, 30), new Point(30, 60)};
myGraphics.DrawPolygon(myPen, myPointArray);

for images something like

Bitmap myBMP = new Bitmap("SpaceCadet.bmp");
Bitmap myGIF = new Bitmap("Soda.gif");
Bitmap myJPEG = new Bitmap("Mango.jpg");
Bitmap myPNG = new Bitmap("Flowers.png");
Bitmap myTIFF = new Bitmap("MS.tif");

myGraphics.DrawImage(myBMP, 10, 10);
myGraphics.DrawImage(myGIF, 220, 10);
myGraphics.DrawImage(myJPEG, 280, 10);
myGraphics.DrawImage(myPNG, 150, 200);
myGraphics.DrawImage(myTIFF, 300, 200);

Nov 15 '05 #3
J
On Mon, 4 Aug 2003 2:21:11 -0400, Leo wrote
(in message <3f***********************@news.free.fr>):
ok thx but it is just some gdi method not handeling the vectorial aspect !
no ?
"Scherbina Vladimir" <vl*********@ukr.net> a écrit dans le message de
news:un**************@TK2MSFTNGP10.phx.gbl...

"Leo" <lv*******@grimladiforum.com> wrote in message
news:3f**********************@news.free.fr...
Hi :

I search some articles explaining how to make a little VectorialDesign
application with simple shape like line circles etc ... in C#
thx !!!

leo~


some examples from sdk:

class PlainForm : Form

{

protected override void OnPaint(PaintEventArgs e)

{

Pen myPen = new Pen(Color.Red, 3);

Graphics myGraphics = e.Graphics;

myGraphics.DrawLine(myPen, 20, 10, 200, 100);

}

}

then just create object of PlainForm :

PlainForm Frm = new PlainForm();

Frm.Show();

put the needed code into OnPaint

for drawing arcs use something like

myGraphics.DrawArc(myPen, 100, 50, 140, 70, 30, 180);

for rectangle

myGraphics.DrawRectangle(myPen, 20, 10, 100, 50);

for polygons

Point[] myPointArray =
{new Point(0, 0), new Point(50, 30), new Point(30, 60)};
myGraphics.DrawPolygon(myPen, myPointArray);

for images something like

Bitmap myBMP = new Bitmap("SpaceCadet.bmp");
Bitmap myGIF = new Bitmap("Soda.gif");
Bitmap myJPEG = new Bitmap("Mango.jpg");
Bitmap myPNG = new Bitmap("Flowers.png");
Bitmap myTIFF = new Bitmap("MS.tif");

myGraphics.DrawImage(myBMP, 10, 10);
myGraphics.DrawImage(myGIF, 220, 10);
myGraphics.DrawImage(myJPEG, 280, 10);
myGraphics.DrawImage(myPNG, 150, 200);
myGraphics.DrawImage(myTIFF, 300, 200);



What you have to do is have virtual Canvas. Have objects that should be
drawn on the virutal canvas. At this point, you have to map the virtual
canvas to the Graphics that you can call gdi+ calls.

j

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
0
by: Leo | last post by:
Hi : I search some articles explaining how to make a little VectorialDesign application with simple shape like line circles etc ... in C# shapes are not a problem i use gdi or gdi+ but it is the...
0
by: Leo | last post by:
Hi : I search some articles explaining how to make a little VectorialDesign application with simple shape like line circles etc ... in C# shapes are not a problem i use gdi or gdi+ but it is the...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
1
by: Hadar | last post by:
Hi, I'm getting "object is currently in use elsewhere" when I use System.Drawing.Graphics.MesureString. This is what I do: My controls use a utility class the helps it to mesure strings. To...
5
by: Jerry J | last post by:
I want to use the System.Drawing.Image class. According to the help file, this is an abstract base class. Because it is supposedly abstract, I created another class that inherits from it. However,...
1
by: YouPoP | last post by:
I am doing an app (C# 2.0) where you can draw in a panel with your mouse in "real time". I actually have 2 problems; 1- it does not really is "real time", if your mouse move fast or very fast the...
2
by: ThatsIT.net.au | last post by:
I have this code that writes a pie chart in a asp.net page, but I want to use it in a server control. When I try I get a error on the last line "Response.OutputStream" Obviously there is no...
7
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.