JPEG as a Container

Reply

Join Date: Jun 2009
Posts: 130
Reputation: stevenpetersen is an unknown quantity at this point 
Solved Threads: 1
stevenpetersen's Avatar
stevenpetersen stevenpetersen is offline Offline
Junior Poster

JPEG as a Container

 
-1
  #1
Sep 1st, 2009
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......
Steven Petersen
Web Designer / Web Master
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 17
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #2
Sep 1st, 2009
Try this approach:
  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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 130
Reputation: stevenpetersen is an unknown quantity at this point 
Solved Threads: 1
stevenpetersen's Avatar
stevenpetersen stevenpetersen is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #3
Sep 1st, 2009
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.
Steven Petersen
Web Designer / Web Master
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 17
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #4
Sep 1st, 2009
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>
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 17
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #5
Sep 1st, 2009
Correction =
  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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 130
Reputation: stevenpetersen is an unknown quantity at this point 
Solved Threads: 1
stevenpetersen's Avatar
stevenpetersen stevenpetersen is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #6
Sep 2nd, 2009
Last edited by stevenpetersen; Sep 2nd, 2009 at 12:15 pm.
Steven Petersen
Web Designer / Web Master
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 17
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #7
Sep 2nd, 2009
Did you add the code?
My JS file is (sorry, I made a mistake).
  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).
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,316
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: JPEG as a Container

 
0
  #8
Sep 2nd, 2009
  1. @media print { img { background:url('./images/copyright.jpg'); } }
  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.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 130
Reputation: stevenpetersen is an unknown quantity at this point 
Solved Threads: 1
stevenpetersen's Avatar
stevenpetersen stevenpetersen is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #9
Sep 3rd, 2009
Originally Posted by codejoust View Post
Did you add the code?
My JS file is (sorry, I made a mistake).
  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....
Steven Petersen
Web Designer / Web Master
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 130
Reputation: stevenpetersen is an unknown quantity at this point 
Solved Threads: 1
stevenpetersen's Avatar
stevenpetersen stevenpetersen is offline Offline
Junior Poster

Re: JPEG as a Container

 
0
  #10
Sep 3rd, 2009
Originally Posted by almostbob View Post
  1. @media print { img { background:url('./images/copyright.jpg'); } }
  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.
Steven Petersen
Web Designer / Web Master
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC