473,796 Members | 2,512 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using low-res images for screen, high-res for printing

Hello all

I have created a page which has several pictures on it. Each picture is
surrounded by a frame made from actual photos of real picture frames,
consisting of four corner tiles and four repeating side tiles.

I would like the on-screen display to use low-res versions (96 dpi) of the
images, to ensure fast loading. But I would like the printed version to
use high-res versions (300 dpi or more). The printed page should be
identical in appearance to the on-screen page, but just with more detail in
the images.

Can I do this using only CSS, with @media screen and @media print?
Thanks in advance.

roger


(BTW, I can get the effect I want using different HTML for the screen and
print. By setting the width and height of an IMG tag, I force it to be a
specific size regardless of the pixel dimensions of the image it contains.
If the image is scaled down in this way, print quality improves a lot.
But to my knowledge, I cannot set the IMG tag to have a different src for
print and screen media using only CSS. Nor can I tile such images easily.)
Jul 20 '05
18 6361
"Spartanicu s" <me@privacy.net > schrieb im Newsbeitrag
news:m0******** *************** *********@news. spartanicus.utv internet.ie...
"Markus Ernst" <derernst@NO#SP #AMgmx.ch> wrote:
<img src="lowres.jpg " ...>
<a href="highres.j pg">High resolution version for printing</a>


This is only suitable if you want to print the image seperately. If I
understand the OP correctly he wants to print out his page layout with thehigh res images included.


Create a copy of the lowres html page with the highres image on it.


Ahem... yes, that's easier :-)
Jul 20 '05 #11
*Roger Shrubber* <ro************ **@hotmail.com> :

I would like the on-screen display to use low-res versions (96 dpi) of
the images, to ensure fast loading. But I would like the printed
version to
use high-res versions (300 dpi or more).
Well, FlashPix would have promised an answer.
Can I do this using only CSS, with @media screen and @media print?


With /hackish/ HTML and CSS3:

<img class="withhire s" src="lowres.img " longdesc="hires .img" alt="foo">

@media print {
img.withhires {content: attr(longdesc, uri)}
}

--
"For every human problem, there is a neat, simple solution;
and it is always wrong." H. L. Mencken
Jul 20 '05 #12
Christoph Paeper wrote:
With /hackish/ HTML and CSS3:

<img class="withhire s" src="lowres.img " longdesc="hires .img" alt="foo">

@media print {
img.withhires {content: attr(longdesc, uri)}
}


That's not a hack any more. That's böse.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #13
*Johannes Koch* <ko**@w3develop ment.de>:
Christoph Paeper wrote:
With /hackish/ HTML and CSS3:
<img class="withhire s" src="lowres.img " longdesc="hires .img"
alt="foo">
@media print {
img.withhires {content: attr(longdesc, uri)}}


That's not a hack any more. That's böse.


Of course, but did I mention that hires.img is content-negotiated and only
returns an image, when the Accept header didn't include 'text/html'
explicitly?
Er, haven't tested yet if or how UAs modify their HTTP headers for CSS's
'content'. They usually do alter it for 'src'.

O N L Y D O T H I S A T L O C A L H O S T, K I D S!

--
"Music is essentially useless, as life is."
George Santayana
Jul 20 '05 #14
Christoph Paeper wrote:
*Johannes Koch* <ko**@w3develop ment.de>:
Christoph Paeper wrote:
With /hackish/ HTML and CSS3:
<img class="withhire s" src="lowres.img " longdesc="hires .img"
alt="foo">
@media print {
img.withhires {content: attr(longdesc, uri)}}

That's not a hack any more. That's böse.

Of course, but did I mention that hires.img is content-negotiated and
only returns an image, when the Accept header didn't include
'text/html' explicitly?


AFAIK, IE doesn't mention 'text/html' in its Accept header. And AFAIK at
least some screean readers / voice browsers use IE. So they will get an
image when activating the long description?

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #15
Johannes Koch wrote:
AFAIK, IE doesn't mention 'text/html' in its Accept header.


That is correct. It includes several image formats, MS binary formats
(e.g., msword), and, finally, */*.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #16
@import "disclaimer.inc ";

*Johannes Koch* <ko**@w3develop ment.de>:
Christoph Paeper wrote:
did I mention that hires.img is content-negotiated and only returns an
image, when the Accept header didn't include 'text/html' explicitly?
AFAIK, IE doesn't mention 'text/html' in its Accept header.


Correct, I forgot. Do UAs put the CSS's URL into the Referer for 'url()'?
So they will get an image when activating the long description?


Yes, blame stupid IE! Of course you could _abuse_ the 'title' or 'alt'
attributes as well.

--
Useless Fact #15:
America was named after the Ostrogoth royal house. Indirectly.
Jul 20 '05 #17
Mark Tranchant <ma**@tranchant .plus.com> wrote in message news:<Xn******* ************@st ones.force9.net >...
Roger Shrubber wrote:
I would like the on-screen display to use low-res versions (96 dpi) of the
images, to ensure fast loading. But I would like the printed version to
use high-res versions (300 dpi or more). The printed page should be
identical in appearance to the on-screen page, but just with more detail in
the images.

Can I do this using only CSS, with @media screen and @media print?


I *think* so (untested).

Build your page using <div>s for the images, assigning them an ID and no
other attribute [1].

In the separate print and screen,projecti on [2] CSS files, set the <div>
dimensions and appropriate image as the <div> background.


This is what I had first hoped would work, however the background image is
not scaled to fit the div - it is simply tiled until the div is filled.

For "@media screen", one image pixel corresponds to one on-screen pixel.
For "@media print", the browser appears to come up with some arbitrary ratio
for image pixels to printer pixels.

roger
Jul 20 '05 #18
On Wed, 07 Jul 2004 18:38:27 +0200, Christoph Paeper
<ch************ **@nurfuerspam. de> wrote:

Yes, blame stupid IE! Of course you could _abuse_ the 'title' or 'alt'
attributes as well.


I tried this the other day to add CSS-only (non-essential) headings to
DIV elements using :before. It worked like a charm, except for the
fact that IE and FireFox of course decided to make the entire DIV
element have a tooltip!

-Claire
Jul 20 '05 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5784
by: Matt Priest | last post by:
I am trying to learn more about how to effectively mix low-level C code with C++. I am having trouble finding resources/papers/books that aren't in one or the other camp exclusively. Can anyone point me toward a good place to start? I want to understand how to make decisions about the development environment, code structure and planning, and any other issues that I'm not aware of that may be important to know. Thanks in advance!
0
1893
by: Andrew | last post by:
When will .NET have a low-pause-time garbage collector A low-pause-time garbage collector would greatly improve .NET's ability to serve as a platform for soft real-time systems. It doesn't have to be perfect. For example, I'd be happy with something where there was at most one pause per second, each pause was less than .2 seconds, and half the process's memory was inaccessible to the application due to garbage collection management It...
13
9651
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be assigned to a variable and output using document.write. (Note, there is no submit button or other form elements. Basically
1
3295
by: Sun G | last post by:
Since I have converted my Access97 application to Access2003, I am getting an warning while opening the Access Database. When Macro Security level set to Low, its working fine. Now, I want to set Macro Security using VBA and not directly. As this application is in use at 100s of place. Can anyone suggest me how can I set Macro Security level to Low using VBA. Thanks Sun
26
10885
by: Bruno Jouhier [MVP] | last post by:
I'm currently experiencing a strange phenomenon: At my Office, Visual Studio takes a very long time to compile our solution (more than 1 minute for the first project). At home, Visual Studio compiles the same solution much faster (about 10 seconds for the first project). My home computer is only marginally faster than the one I have at the office (P4 2.53 vs. P4 2.4, same amount of RAM). On the slow machine, the CPU usage is very low,...
5
5179
by: muscha | last post by:
Hi, I'm trying to decide whether I should use Guid.NewGuid() to generate an ID or using database sequence. Is Guid.NewGuid() will return a unique number? The MSDN said that the probability of duplication is low, but how low? Does anyone know? thanks, /m
1
7355
by: kingster | last post by:
Hi, I have a regular dataset and all i want to do is make a pivot table display in a browser with the datasource of the pivot table to be this dataset and then the end-user will be able to do whatever they want ... i dont need to do any special formatting just a straigh ot pivot tables usign sql server, asp.net, vb.net, OWC 10
16
3281
by: Martin Jørgensen | last post by:
Hi, I've made a program from numerical recipes. Looks like I'm not allowed to distribute the source code from numerical recipes but it shouldn't even be necessary to do that. My problem is that I'm not very experienced with pointers, pointers to pointers and the like and I got 4 compiler warnings + I don't completely understand how to build this "compact matrix" (see later).
6
1825
by: Pascal Ehlert | last post by:
Hi group! I was trying to build a JS solution for related select lists (child lists gets populated depending on the value selected in parent list), which uses no Ajax and is still "usable" in an environment with JS disabled. 
I have done this with the Low Pro framework which basically just registers event handlers on certain elements chosen by CSS selectors. This is the result: 
http://pastie.caboo.se/136818 The initialize function...
5
3793
by: ryuchi311 | last post by:
In C++ using arrays. I need to create a C Program that will ask for five integers input from the user, then store these in an array. Then I need to find the lowest and highest integers inside that array and add them together. The output will be the result in this format: LOWEST+HIGHEST=SUM #include<stdio.h> void main (){ int r, low, hig, ans, index; for(index=0, index<4, index++){ printf("Enter number");
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10221
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.