473,406 Members | 2,633 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,406 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 4509

"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.