Hi Richard,
Sorry I was unclear on that. I got confused by that mentioning of css althought to print something does not necessarily involve css just a javascript function:
window.print();
This always prints the current window with all the content. It's here when css comes in. Without opening a new window with a printer friendly page you can tell the browser to print a page for a different media this time (for the printer)
Well, but that's not entirely what you want. You want just the image.
What you actually can do is to create a different file and place everything on that you want to appear when the user clicks on that button that prints your picture. So you would just paste a picture and then open it in a new window then from that window with the image in it you call the event in the button like this
<input type="button" value="Print image" onclick="javascript:window.print();">
Again, I don't think you want to open new windows.
A workaround is a hidden frame that loads with your page.
<frameset rows="100%,*">
<frame src="mainpage.htm" name="mainp">
<frame src="imagepage.htm" name="imagep">
</frameset>
Put this in your main page:
<script language="JavaScript">
if (window.print)document.write('<form><input type="button" value="Print" onClick="parent.frames[imagep].focus();parent.frames[imagep].print()"><\/form>');
</script>
Well, I heard there's some css workaround to this problem but I'm more into scripting so you have to check that out yourself.
HTH,
Lillu
If you want to get a job done, ask a busy person. (Sherry Conway Appel - American writer)