Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors
Text, Lines, Vectors Text, Lines, Vectors
Text, Lines, Vectors
Go Back  Xtreme Visual Basic Talk > > > Text, Lines, Vectors


Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2014, 02:24 PM
holtzy holtzy is offline
Senior Contributor
 
Join Date: Jul 2002
Location: USA
Posts: 1,054
Talking Text, Lines, Vectors


I have a bitmap that I am currently drawing text, lines, and circles on. I have this data as points, so I can redraw these by any means necessary.

I have the need to print these and am able to get an acceptable quality, but only at the cost of the file size. Each file is around 20 MB. Is there some way to draw these as vectors and print and vectors to keep quality, but reduce the file size?
__________________
God is good!!!
Reply With Quote
  #2  
Old 02-19-2014, 03:45 PM
Gruff's Avatar
GruffText, Lines, Vectors Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

How are you drawing them in your picturebox. You are using vector information correct?

You Draw the same information to the printer page then print the page.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #3  
Old 02-20-2014, 04:24 AM
boops boops's Avatar
boops boops boops boops is offline
Centurion
 
Join Date: Dec 2006
Location: Holland and France
Posts: 146
Default

Quote:
Originally Posted by holtzy View Post
I have a bitmap that I am currently drawing text, lines, and circles on. I have this data as points, so I can redraw these by any means necessary.

I have the need to print these and am able to get an acceptable quality, but only at the cost of the file size. Each file is around 20 MB. Is there some way to draw these as vectors and print and vectors to keep quality, but reduce the file size?
If the file size is 20 MB, it's pretty clear to me that you are saving the drawing as a rasterized image (bitmap, jpeg etc.) instead of as vector data. Even with a huge amount of vector data, a file containing just that data should be tiny compared to a bitmap. I suggest you look into doing all your drawing using GraphicsPaths. The principle is simple. Instead of drawing a circle with Graphics.DrawEllipse, you add it to a path with GraphicsPath.AddEllipse, for example:
Code:
Dim gp As New Drawing2D.GraphicsPath
gp.AddEllipse(rectangle1)

'then to draw the path (best done in a Paint event handler) with a graphics object called g:
g.FillPath(Brushes.Pink, gp)
g.DrawPath(Pens.Blue, gp)
Similarly there are graphics path statements like AddLine, AddRectangle, AddPolygon, AddString, AddBezier etc. The graphics path does not contain pens or brushes, just the "geometry" of the line. Drawing or printing the rendered image will be no less efficient -- in many cases more so -- than drawing the whole raster image with Graphics.DrawImage or by loading an image file as a picturebox Image.

You can save the path to a file by serializing it. The main data to be serialized is just an array of points with a parallel array of bytes representing point types (line, Bezier control point etc.) so the resulting file is very small. You can find countless examples of how to serialize a path by googling for "serialize a drawing2d.GraphicsPath". The first one I came across that looks like helpful is here, but I haven't tested it.

BB
Reply With Quote
  #4  
Old 03-01-2014, 02:52 PM
hDC_0Text, Lines, Vectors hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 559
Default One of my bookmarks..

To boops boops - thanks for the serialization link. I bookmarked it.

Here's another one back at you (from my many bookmarks):
DotNetHeaven: Printing Graphics in GDI+ using VB.NET
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors Text, Lines, Vectors
Text, Lines, Vectors
Text, Lines, Vectors
 
Text, Lines, Vectors
Text, Lines, Vectors
 
-->