Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Interface and Graphics > Pixels to Inches


Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2004, 02:47 AM
Jdo300's Avatar
Jdo300 Jdo300 is offline
Junior Contributor
 
Join Date: Jul 2002
Location: Ohio
Posts: 287
Question Pixels to Inches


Hello, I have a couple of questions concerning printing images to scale. I have a program I made that displays a graph of a spiral on the screen. When I run my equations in the program, I use pixels as my units of measurement, and the graph ticks are also marked off in pixels. But I also want to be able to have the user enter equation parameters in inches and have the graph image display the tick marks in inches and print off in inches as well. I looked around for conversion formulas and some were talking about how you have to take the DPI of the printer into consideration. I’m just curious to know if there is an easier way to converting the pixels to inches and have the image graph print out in inch units on the real paper. If this sounds a bit confusing, I can elaborate on it if someone responds.



Thanks,

Jason O
__________________
Microsoft Works..... Hahahahaaha
Reply With Quote
  #2  
Old 03-14-2004, 03:11 AM
DaftasBrush's Avatar
DaftasBrush DaftasBrush is offline
Senior Contributor

* Expert *
 
Join Date: Jun 2003
Location: A room without Windows
Posts: 896
Default

Use TWIPS

If you work in twips instead, you can ignore the DPI of a printer, as the output size will be a certain number of twips (1440 say)
and the printer will print as many pixels (dots) as it needs to get that, so a 300DPI printer will print 300 dots in that inch.

HTH
__________________
Dan B
"Don't anthropomorphize computers. They don't like it."
Trig is for wuss's - Coordinate Geometry RULES!
Reply With Quote
  #3  
Old 03-14-2004, 04:14 PM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 7,714
Default

Or you could set the ScaleMode to Inches (ScaleMode = vbInches).
Then everything you draw you would specify in inches (fractions of an inch, most likely).
You would set the Printers.ScaleMode to Inches as well, and then draw on the printer the
same way. (Of course, you can use twips, as DaftasBrush says, or points, for that matter, since they are directly related to inches, 72 points per inch, 20 twips per point).
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
saving a picture file ByteMe Interface and Graphics 9 03-08-2004 11:42 AM
How to change the form scale mode to Pixels rameshmelam Game Programming 2 11-29-2003 05:37 AM
Translation of twips to pixels in WIndows NT rbarella Miscellaneous Languages 1 10-31-2003 11:04 PM
Pixels? What pixels? gazmac General 3 04-02-2003 11:52 AM
Pixels not permanent after setpixel in picturebox ? Garmour API 3 02-07-2003 05:46 AM

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
 
 
-->