943,745 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Sep 1st, 2009
-1

JPEG as a Container

Expand Post »
I was told by one of my friends in a high place that you can make a JPEG into a Container to carry what every you need..... My idea is to put a Java Script in the Container that makes the picture uncopyable to print page and right click..... Also would like to put a note pad into the Image for copywrites information. The Question is........ HOW DO YOU MAKE A JPEG IMAGE A CONTAINER......
Similar Threads
Reputation Points: 45
Solved Threads: 1
Junior Poster
stevenpetersen is offline Offline
132 posts
since Jun 2009
Sep 1st, 2009
0

Re: JPEG as a Container

Try this approach:
javascript Syntax (Toggle Plain Text)
  1. $(function(){
  2. $('img').each(function(){
  3. $(this).bind("rightclick mouseover mouseout drag",function(){return false;});
  4. $('body').append('<div class="trans">&nbsp;</div>').css({'width':$(this).width()+'px',
  5. 'height':$(this).height()+'px',
  6. 'position':'absolute',
  7. 'top':$(this).offset().top+'px',
  8. 'left':$(this).offset().left+'px',
  9. 'background':'transparent'});
  10. });
  11. });
(this example using jquery)
Last edited by codejoust; Sep 1st, 2009 at 2:18 pm.
Reputation Points: 18
Solved Threads: 21
Junior Poster
codejoust is offline Offline
180 posts
since Jul 2009
Sep 1st, 2009
0

Re: JPEG as a Container

Where does this go? Into the jpeg container, header, or JS file?



This post is a current project
Last edited by stevenpetersen; Sep 1st, 2009 at 7:02 pm.
Reputation Points: 45
Solved Threads: 1
Junior Poster
stevenpetersen is offline Offline
132 posts
since Jun 2009
Sep 1st, 2009
0

Re: JPEG as a Container

I'd you can give me a link (Or pm) I might be able to help.
To answer your question, you add it in a <script type="text/javascript">[my code]</script>
<script type="text/javascript" src="[scr of jquery]"></script>
Reputation Points: 18
Solved Threads: 21
Junior Poster
codejoust is offline Offline
180 posts
since Jul 2009
Sep 1st, 2009
0

Re: JPEG as a Container

Correction =
html Syntax (Toggle Plain Text)
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  2. <script type="text/javascript" src="path/to/my.js"></script>
and probably in the header.
Last edited by codejoust; Sep 1st, 2009 at 8:07 pm.
Reputation Points: 18
Solved Threads: 21
Junior Poster
codejoust is offline Offline
180 posts
since Jul 2009
Sep 2nd, 2009
0

Re: JPEG as a Container

Last edited by stevenpetersen; Sep 2nd, 2009 at 12:15 pm.
Reputation Points: 45
Solved Threads: 1
Junior Poster
stevenpetersen is offline Offline
132 posts
since Jun 2009
Sep 2nd, 2009
0

Re: JPEG as a Container

Did you add the code?
My JS file is (sorry, I made a mistake).
javascript Syntax (Toggle Plain Text)
  1. $(function(){
  2. $('img').each(function(){
  3. $('<div class="trans">&nbsp;</div>').appendTo('body').css({
  4. 'width':($(this).width() + 20)+'px',
  5. 'height':($(this).height() + 20)+'px',
  6. 'position':'absolute',
  7. 'top':$(this).offset().top+'px',
  8. 'left':$(this).offset().left+'px',
  9. 'background':'transparent'});});
  10. $('img, .trans').bind("rightclick mousedown contextmenu mouseover mouseout drag",function(){return false;});
  11. });
Take that code and put it in a .js file, using the html I provided above in the header to use it (the 2 script tags).
Reputation Points: 18
Solved Threads: 21
Junior Poster
codejoust is offline Offline
180 posts
since Jul 2009
Sep 2nd, 2009
0

Re: JPEG as a Container

css Syntax (Toggle Plain Text)
  1. @media print { img { background:url('./images/copyright.jpg'); } }
html Syntax (Toggle Plain Text)
  1. <img style="background:url('./images/realpic.jpg')" src='./images/blank.gif' width='width of realpic' height='height of realpic'>
  2. <img style="background:url('./images/anotherpic.jpg')" src='./images/blank.gif' width='width of anotherpic' height='height of anotherpic'>
blank.gif is a 1px transparent .gif image
all images have the same src, the background is the real image
the print styling is generic, can be refined to take a class or id of image to copyright, and allow non-copyright images to print
Last edited by almostbob; Sep 2nd, 2009 at 9:54 pm.
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Sep 3rd, 2009
0

Re: JPEG as a Container

Click to Expand / Collapse  Quote originally posted by codejoust ...
Did you add the code?
My JS file is (sorry, I made a mistake).
javascript Syntax (Toggle Plain Text)
  1. $(function(){
  2. $('img').each(function(){
  3. $('<div class="trans">&nbsp;</div>').appendTo('body').css({
  4. 'width':($(this).width() + 20)+'px',
  5. 'height':($(this).height() + 20)+'px',
  6. 'position':'absolute',
  7. 'top':$(this).offset().top+'px',
  8. 'left':$(this).offset().left+'px',
  9. 'background':'transparent'});});
  10. $('img, .trans').bind("rightclick mousedown contextmenu mouseover mouseout drag",function(){return false;});
  11. });
Did not work for me..... ill leave it up here
im going to try this other one here as well thank you....
Reputation Points: 45
Solved Threads: 1
Junior Poster
stevenpetersen is offline Offline
132 posts
since Jun 2009
Sep 3rd, 2009
0

Re: JPEG as a Container

Click to Expand / Collapse  Quote originally posted by almostbob ...
css Syntax (Toggle Plain Text)
  1. @media print { img { background:url('./images/copyright.jpg'); } }
html Syntax (Toggle Plain Text)
  1. <img style="background:url('./images/realpic.jpg')" src='./images/blank.gif' width='width of realpic' height='height of realpic'>
  2. <img style="background:url('./images/anotherpic.jpg')" src='./images/blank.gif' width='width of anotherpic' height='height of anotherpic'>
blank.gif is a 1px transparent .gif image
all images have the same src, the background is the real image
the print styling is generic, can be refined to take a class or id of image to copyright, and allow non-copyright images to print
Got It props too you my friend.....


What about the Print Screen
Last edited by stevenpetersen; Sep 3rd, 2009 at 4:41 pm.
Reputation Points: 45
Solved Threads: 1
Junior Poster
stevenpetersen is offline Offline
132 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Graphics and Multimedia Forum Timeline: New bee here…!
Next Thread in Graphics and Multimedia Forum Timeline: Interactive UK map in flash, with counties or postcode area





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC