Drawing Images in classes


Posted on 16th Feb 2014 07:03 pm by admin

I'm quite new to Object Oriented PHP. What I'm trying to do is draw some images but also have other content on the page.

Code: include('images.php');
//New Image set
$im=new images();

//Sends headers and images don't work
echo "hello";

//New rect
$us=$ge->rect("Title");
$us->setDimensions(300,300);
$us->setBgColor('#606060');
$us->createImage();

There are 2 classes; images which extends rect. In the createImage() it draws an image on index.php?img=0 but only if no other headers are sent yet.
Code: function createImage(){
if ($_GET['img']==$this->id){
...
Code: imagepng($this->im);
ImageDestroy ($im);}
Is there anyway to draw this objects and also have content. I tried to see if I could draw the images through the images class like images.php?img=0 but that didn't work. I was also thinking if there was a way to send an if back to index from constructor and destructor. This is probably really confusing sorry, an help is appreciated

No comments posted yet

Your Answer:

Login to answer
241 Like 40 Dislike
Previous forums Next forums
Other forums

Need help adding a timestamp to my filename/variable
Hello,

I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a f

Php mysql - select?
Hi i have this code:
Code: $iteminfo = mysql_query("SELECT desc FROM wc_items WHERE itemid =

Array becomes unset by itself?
Hi,

I have a bit of experience with PHP but not extensive. It seems I cannot store any items

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

validating url
im trying to validate url's sent to me by a form
the url's im collecting are for placing banners

calendar dates and hours compare problem
i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same

PRotect my POST DATA... FROM HTML ATTACKS
I need to like let's say

If a user submit's his Prayer and he put's <meta refresh stuf

How to use php and sql to check if values match the ones in a table (for logins)
How would I code it that the script takes two variables that are passed to it (UserID and PIN), and

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

How many users online in the last 24-hours using time()?
I'm fairly new to PHP. I have a MySQL table called 'users' and a field called 'loggedin' which is in

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash