Automatic Background Resize |
[eluser]DocFunky![/eluser]
Hello World ! I would like the background to get automatically adapted to the screen resolution. So, here is what I did, but I get an erro message, let me show you : First I wanna get the User Screen through a Cookie (I definitively don't want it to get by the GET method) : Code: <?php Forget about the French comments, useless Then, I get my pic and load the librairy I found there : Librairy : http://ellislab.com/forums/viewthread/178095/ Then I get my image in a variable Code: $Pic="Paris.jpg"; That I want to give to the function right after, so I get : Code: <?php So considering the Directions for the Image Manip librairy, we should have something la this : Code: $this->images->resize('full_path on image', 'path of new image', '120','90')); All this code is here in order to get a resized image background so that right after this code I have Code: <body background=" <?php echo base_url();?>assets/images/background/<?php $Pic ?>Resized.jpg" > And you will find this code in the header of my website. Just before the logo get printed. That what I think I did ... I'm not sure about the images paths, does base_url().assets/images/background/.$Pic.".jpg" work ? Well definitively not, I don't know how to do something like this. So I tried first with static paths like assets/images/background/Paris.jpg for each of the url (No need to rewrite it here .. well let's do it : Code: $Pic="Paris"; ) So now here is me problem : Here is my error message I get when I try : Quote:A PHP Error was encountered So line 109 is this one : Code: $this->images->resize(localhost/codeIgniter/assets/images/background/Paris.jpg , localhost/codeIgniter/assets/images/background/ParisResized.jpg , $width, $height); Why isn't it considered as an object ? |
Welcome Guest, Not a member yet? Register Sign In |