PHP Forum

Drawing Images in classes

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.

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

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

//New rect
$us=$ge->rect("Title");
$us->setDimensions(300,300);
Advertisement
$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
Advertisement

0 answers

No answers posted yet. Be the first to answer.

Your answer

Login to answer

Trending today: see what people are reading