Solved

copyright watermark with css

Posted on 2006-06-16
3
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

730 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