Solved

copyright watermark with css

Posted on 2006-06-16
3
250 Views
Last Modified: 2013-11-19
HI. I am tryin to do this:




output an img (no width/height attributes available), then somehow over the top of the image, add a layer that is has part transparent text stating 'copyrighted'. but the layer must adjust itself to the size of whatever image is outputted. anyone any ideas?
0
Comment
Question by:jgnunn
3 Comments
 
LVL 18

Expert Comment

by:Morcalavin
ID: 16922514
I don't believe such a thing is possible with javascript.  You would have to use perl/php/ruby etc and use their image manipulation modules/function to modify the image.
It may be possible to "simulate"  a watermark on the image using javascript, but if the user saved the image or direct linked to it, the watermark wouldnot be present.
0
 
LVL 1

Author Comment

by:jgnunn
ID: 16922600
sorry, i thought id posted this in the css section...

..image couldnt be right clicked copied if its in the background=, i know theres other ways for them to get the image, but im just tryin to make it 'not easy'.

I can do it with a <table background= , then insert a transparent.gif in the <td> , but i need the width and height attribs of the img for it work, so am looking for another alt..
0
 
LVL 11

Accepted Solution

by:
mvan01 earned 500 total points
ID: 16922975
Maybe you did post in the proper section afterall then ...

Javascript can be used to get the attributes of the image, which you said you need for the <table background= method.  I'll admit I don't know how reliable the function is in JS, as I've seen it fail for me in the past.

Would a method like this help?

<script>
var myImage = new Image();
myImage.src = 'http://www.experts-exchange.com/images/expertAwards2006Button.gif';
var theWidth = myImage.width;
var theHeight = myImage.height;
</script>

... all done without displaying the image, and therefore can be done before displaying the image, or rendering the page, if necessary.

Peace and joy.  mvan
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Make Session back to empty 9 30
Binding a Grid in Javascript 5 43
asp Google Map 2 32
ASP.NET MVC -Update model when click on <li> element 29 34
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question