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
Did you know?Explore Trending and Topic pages for more stories like this.
$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

form help
this doesn't work. i want the form action to go the location.href of the submit button chosen.. how

DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This i

What are the two different files you download to update kernel?
What are the two different files you download to update kernel?

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Problem with php's rename function
So, i'm having a problem with the php rename function. Basically my script 'delete_user.php' attempt

How to file_get_contents when login required?
Hello!

I am trying to read data from a page that you have to be logged into to view, I am try

Create multiple (n) arrays
Hi there,

I have the following need:

I have 2 arrays (coming from a databases)

COOIS - Saving Object Overview WIP Status layouts
COOIS - Would like to be able to save the layout of an Object Overview - WIP Status report. There i

article site help remaining text
Hi all hope you will be fine
I am creating a article site in this site i want to put some text on

[function.file]: failed to open stream: No such file or directory
Okay I wrote this little script to upload a csv file that is located on my webhosts server to a mysq

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