vector based 2D line drawing
-
Hi, How can i vector based 2D line drawing in C#. I want to get smooth line when i get printout, so i don't want to pixel based drawing. Whats is the easiest way? many thanks...
-
Hi, How can i vector based 2D line drawing in C#. I want to get smooth line when i get printout, so i don't want to pixel based drawing. Whats is the easiest way? many thanks...
Sorry? You need to explain yourself in a reasonable amount of detail to get any real help - we only get exactly what you type to work from: we can't see your screen, access your HDD, or read your mind. What are you printing? what are you printing on? when you say "smooth line" what do you mean? Statistically smoothed, antialiased? Approximated to a particular curve? What have you tried? What did it do that you didn't want, or not do that you did? What help do you need? The better your question, the better the help we can give: conversely, the less information you give, the less help we can provide.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Hi, How can i vector based 2D line drawing in C#. I want to get smooth line when i get printout, so i don't want to pixel based drawing. Whats is the easiest way? many thanks...
Using Vector (SVG) Graphics in C# .NET – lasitha.blog();[^]
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
Hi, How can i vector based 2D line drawing in C#. I want to get smooth line when i get printout, so i don't want to pixel based drawing. Whats is the easiest way? many thanks...
Ummm....Unless you have a vector monitor (think arcade games like Asteroids and Tempest), you have no choice. Those games are drawn on screen by directly controlling the electron gun in the display tube using analog signals. That simply isn't possible in modern monitors. They use completely different technology to render (and scan) the entire screen instead of just what's drawn on it. You're going to use pixel-based display technology no matter what. So, I think what you're looking for is to avoid the "jaggies" when drawing lines. Well, you can minimize the jaggies, but you cannot eliminate them. Commonly, that's done using anti-aliasing techniques, but exactly what you do is dependent on your application and what you're doing in it.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
Sorry? You need to explain yourself in a reasonable amount of detail to get any real help - we only get exactly what you type to work from: we can't see your screen, access your HDD, or read your mind. What are you printing? what are you printing on? when you say "smooth line" what do you mean? Statistically smoothed, antialiased? Approximated to a particular curve? What have you tried? What did it do that you didn't want, or not do that you did? What help do you need? The better your question, the better the help we can give: conversely, the less information you give, the less help we can provide.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
Actually I want to draw cross line use with X - Y coordinates and save as PDF format. For example FROM New Point(x: 10, y: 10) TO New Point(x: 15, y: 5) AND DRAW LINE. If I use GDI+ library, this line shown pixel. I want to smooth line. MS Paint Pixel based drawing program, If I draw cross line on MS Paint, will be shown pixel. If I use Inkscape (its vector graphics software) and draw cross line after save as PDF file so line will be smooth.
-
Ummm....Unless you have a vector monitor (think arcade games like Asteroids and Tempest), you have no choice. Those games are drawn on screen by directly controlling the electron gun in the display tube using analog signals. That simply isn't possible in modern monitors. They use completely different technology to render (and scan) the entire screen instead of just what's drawn on it. You're going to use pixel-based display technology no matter what. So, I think what you're looking for is to avoid the "jaggies" when drawing lines. Well, you can minimize the jaggies, but you cannot eliminate them. Commonly, that's done using anti-aliasing techniques, but exactly what you do is dependent on your application and what you're doing in it.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakActually I want to draw cross line use with X - Y coordinates and save as PDF format. For example; FROM New Point(x: 10, y: 10) TO New Point(x: 15, y: 5) AND DRAW LINE. If I use GDI+ library, this line shown pixel. I want to smooth line. MS Paint Pixel based drawing program, If I draw cross line on MS Paint, will be shown pixel. If I use Inkscape (its vector graphics software) and draw cross line after save as PDF file so line will be smooth.
-
Using Vector (SVG) Graphics in C# .NET – lasitha.blog();[^]
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
Thanks for reply, bu i dont want to render image, i just; want to draw line from x-y point to x-y point GDI+ Sample; Pen myPen = new Pen(Color.Blue, 2); Point myStartPoint = new Point(10, 10); Point myEndPoint = new Point(15, 5); myGraphics.DrawLine(myPen, myStartPoint, myEndPoint); But its created pixel by pixel. Real example; If I use MS Paint and i draw cross line, line will be shown pixel by pixel If I use Inkscape (its vector graphics software) and i draw cross line, line will be shown smooth. thanks...
-
Actually I want to draw cross line use with X - Y coordinates and save as PDF format. For example FROM New Point(x: 10, y: 10) TO New Point(x: 15, y: 5) AND DRAW LINE. If I use GDI+ library, this line shown pixel. I want to smooth line. MS Paint Pixel based drawing program, If I draw cross line on MS Paint, will be shown pixel. If I use Inkscape (its vector graphics software) and draw cross line after save as PDF file so line will be smooth.
So draw it directly onto the PDF rather than onto a bitmap. What code are you using at the moment to draw it into the PDF file?
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Thanks for reply, bu i dont want to render image, i just; want to draw line from x-y point to x-y point GDI+ Sample; Pen myPen = new Pen(Color.Blue, 2); Point myStartPoint = new Point(10, 10); Point myEndPoint = new Point(15, 5); myGraphics.DrawLine(myPen, myStartPoint, myEndPoint); But its created pixel by pixel. Real example; If I use MS Paint and i draw cross line, line will be shown pixel by pixel If I use Inkscape (its vector graphics software) and i draw cross line, line will be shown smooth. thanks...
dataminers wrote:
If I use MS Paint and i draw cross line, line will be shown pixel by pixel
Aight; do that on a 100x100 pixel canvas. Draw a line from (0,0) to (100,100). Now zoom in. The pixels "grow", yes? Traditionally, we save a picture by describing each pixel*. If you save a set of drawing-instructions, like "line (0,0) (x-max, y-max)", then you will always get the smoothest line possible. The line itself is still pixels toggeling, because that is what your screen is showing you: pixels that form a screen. If you look up the resolution of your monitor, then that is expressed in "dots per inch", because dots is what make up your image. As long as we use dots to display stuff, we will have pixels to draw on. --edit The "SVG" filetype is a way of saving graphics in said form; it will look "sharp" when importing in PDF. That's the format Inkscape is using too.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
Hi, How can i vector based 2D line drawing in C#. I want to get smooth line when i get printout, so i don't want to pixel based drawing. Whats is the easiest way? many thanks...
dataminers wrote:
i get printout,
All printers generally available are pixel based. Thus there is no absolute way to produce a 'line'. There might be expensive line based printers. There used to be but that was when pixel based printing was very rough or even non-existent. What one does these days is to craft a pixel based output that looks like a line. Which should be fairly easy to do now given how small the pixels are these days. There are articles about how to do line approximation using pixels which you can google for.