Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Pixels per Inch

Reply
Thread Tools

Pixels per Inch

 
 
headware
Guest
Posts: n/a
 
      12-04-2007
I have to create some vertical text for a web page that allows users
to print to labels. We decided to do this by creating an <img> tag on
the web page and having the src attribute point to another ASP.NET
page that generates the image on the fly and streams it back to the
browser. It works fine, but I'm worried about sizing issues. The image
has to be a specific height and width to fit properly onto the label.
The constructor for the Drawing.Bitmap class (which is what we're
using to generate the image) takes pixels as arguments, not inches or
any "real" measurements. I don' t think that pixels are absolute
measurements of length are they? I think they differ in size between
platforms and maybe even monitors.

Since it's a web page, we can't rely on any particular browser or
platform. I could set the width and height attributes on the <img> tag
but that can stretch the image and make the text hard to read. I could
also put the <img> tag into a <div> of fixed size but that may cut off
parts of the image if it ends up being too big. I'd rather have a way
for the browser to tell the image generating page how many pixels per
inch it can handle. I'm not sure if you can get that kind of data from
the browser, but that would probably work if we could.

Any suggestions would be appreciated.

Thanks,
Dave
 
Reply With Quote
 
 
 
 
Nick Chan
Guest
Posts: n/a
 
      12-04-2007
>I could
>> also put the <img> tag into a <div> of fixed size but that >may cut off
>> parts of the image if it ends up being too big.



u could set the img width to be 100% width&height of the div container
using some css




On Dec 4, 8:19 am, headware <(E-Mail Removed)> wrote:
> I have to create some vertical text for a web page that allows users
> to print to labels. We decided to do this by creating an <img> tag on
> the web page and having the src attribute point to another ASP.NET
> page that generates the image on the fly and streams it back to the
> browser. It works fine, but I'm worried about sizing issues. The image
> has to be a specific height and width to fit properly onto the label.
> The constructor for the Drawing.Bitmap class (which is what we're
> using to generate the image) takes pixels as arguments, not inches or
> any "real" measurements. I don' t think that pixels are absolute
> measurements of length are they? I think they differ in size between
> platforms and maybe even monitors.
>
> Since it's a web page, we can't rely on any particular browser or
> platform. I could set the width and height attributes on the <img> tag
> but that can stretch the image and make the text hard to read. I could
> also put the <img> tag into a <div> of fixed size but that may cut off
> parts of the image if it ends up being too big. I'd rather have a way
> for the browser to tell the image generating page how many pixels per
> inch it can handle. I'm not sure if you can get that kind of data from
> the browser, but that would probably work if we could.
>
> Any suggestions would be appreciated.
>
> Thanks,
> Dave


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      12-04-2007
you can specify the image size in points (about 72 points/inch) which
will transfer to the printer correctly. the browser will scale it, just
be sure you have enough resolution.

-- bruce (sqlwork.com)


headware wrote:
> I have to create some vertical text for a web page that allows users
> to print to labels. We decided to do this by creating an <img> tag on
> the web page and having the src attribute point to another ASP.NET
> page that generates the image on the fly and streams it back to the
> browser. It works fine, but I'm worried about sizing issues. The image
> has to be a specific height and width to fit properly onto the label.
> The constructor for the Drawing.Bitmap class (which is what we're
> using to generate the image) takes pixels as arguments, not inches or
> any "real" measurements. I don' t think that pixels are absolute
> measurements of length are they? I think they differ in size between
> platforms and maybe even monitors.
>
> Since it's a web page, we can't rely on any particular browser or
> platform. I could set the width and height attributes on the <img> tag
> but that can stretch the image and make the text hard to read. I could
> also put the <img> tag into a <div> of fixed size but that may cut off
> parts of the image if it ends up being too big. I'd rather have a way
> for the browser to tell the image generating page how many pixels per
> inch it can handle. I'm not sure if you can get that kind of data from
> the browser, but that would probably work if we could.
>
> Any suggestions would be appreciated.
>
> Thanks,
> Dave

 
Reply With Quote
 
headware
Guest
Posts: n/a
 
      12-04-2007
On Dec 4, 1:37 am, bruce barker <(E-Mail Removed)> wrote:
> you can specify the image size in points (about 72 points/inch) which
> will transfer to the printer correctly. the browser will scale it, just
> be sure you have enough resolution.
>
> -- bruce (sqlwork.com)
>
> headware wrote:
> > I have to create some vertical text for a web page that allows users
> > to print to labels. We decided to do this by creating an <img> tag on
> > the web page and having the src attribute point to another ASP.NET
> > page that generates the image on the fly and streams it back to the
> > browser. It works fine, but I'm worried about sizing issues. The image
> > has to be a specific height and width to fit properly onto the label.
> > The constructor for the Drawing.Bitmap class (which is what we're
> > using to generate the image) takes pixels as arguments, not inches or
> > any "real" measurements. I don' t think that pixels are absolute
> > measurements of length are they? I think they differ in size between
> > platforms and maybe even monitors.

>
> > Since it's a web page, we can't rely on any particular browser or
> > platform. I could set the width and height attributes on the <img> tag
> > but that can stretch the image and make the text hard to read. I could
> > also put the <img> tag into a <div> of fixed size but that may cut off
> > parts of the image if it ends up being too big. I'd rather have a way
> > for the browser to tell the image generating page how many pixels per
> > inch it can handle. I'm not sure if you can get that kind of data from
> > the browser, but that would probably work if we could.

>
> > Any suggestions would be appreciated.

>
> > Thanks,
> > Dave


Thanks for the response Bruce. By "point" do you mean pixel? I've read
that the pixels per inch number is not an industry constant. In other
words, 72 pixels does not always equate to 1 inch. I'm pretty confused
about the whole subject and it seems to be hard to find good
information on it. This can't be the first time somebody needed to
print something from a web browser in a precise, reproduceable way.
How do people solve this problem? Is there even a problem to begin
with?
 
Reply With Quote
 
sriduttmiraskar sriduttmiraskar is offline
Junior Member
Join Date: Jun 2008
Posts: 1
 
      06-06-2008
Hi Dave,

I am facing similar problem I am doing a project for one my client, which is sort of designing clothes. I am getting inputs in inches from user, to know length and width of various body-parts and generate image on fly. I am able to do this But real problem comes when he prints this image. This image has to have real sizes what he gave as input. I get correct width but variable height

Please share your solution if have found it already.

Regards,
Sridutt

Quote:
Originally Posted by headware
On Dec 4, 1:37 am, bruce barker <(E-Mail Removed)> wrote:
> you can specify the image size in points (about 72 points/inch) which
> will transfer to the printer correctly. the browser will scale it, just
> be sure you have enough resolution.
>
> -- bruce (sqlwork.com)
>
> headware wrote:
> > I have to create some vertical text for a web page that allows users
> > to print to labels. We decided to do this by creating an <img> tag on
> > the web page and having the src attribute point to another ASP.NET
> > page that generates the image on the fly and streams it back to the
> > browser. It works fine, but I'm worried about sizing issues. The image
> > has to be a specific height and width to fit properly onto the label.
> > The constructor for the Drawing.Bitmap class (which is what we're
> > using to generate the image) takes pixels as arguments, not inches or
> > any "real" measurements. I don' t think that pixels are absolute
> > measurements of length are they? I think they differ in size between
> > platforms and maybe even monitors.

>
> > Since it's a web page, we can't rely on any particular browser or
> > platform. I could set the width and height attributes on the <img> tag
> > but that can stretch the image and make the text hard to read. I could
> > also put the <img> tag into a <div> of fixed size but that may cut off
> > parts of the image if it ends up being too big. I'd rather have a way
> > for the browser to tell the image generating page how many pixels per
> > inch it can handle. I'm not sure if you can get that kind of data from
> > the browser, but that would probably work if we could.

>
> > Any suggestions would be appreciated.

>
> > Thanks,
> > Dave


Thanks for the response Bruce. By "point" do you mean pixel? I've read
that the pixels per inch number is not an industry constant. In other
words, 72 pixels does not always equate to 1 inch. I'm pretty confused
about the whole subject and it seems to be hard to find good
information on it. This can't be the first time somebody needed to
print something from a web browser in a precise, reproduceable way.
How do people solve this problem? Is there even a problem to begin
with?
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
19 inch vs 17 inch LCD akiwi NZ Computing 40 04-27-2005 12:38 AM
Pixels per inch (20D RAW)?? Musty Digital Photography 9 12-27-2004 08:49 PM
Pixels per inch in PowerShot A70 Bob Digital Photography 5 12-16-2004 01:56 PM
Display pixels per inch Mat Computer Support 3 12-11-2003 01:49 PM
Film scanner for 2 1/4 inch by 2 1/4 inch James E Koehler Digital Photography 6 10-16-2003 01:32 PM



Advertisments