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

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

Function module "DPS_CHECK_TABLE_EXISTS" not found (after OSS 1422843 impl)
Dear All,

I implemented Note OSS 1422843.

When i execute the new report RSPO20

url- go to webpage
i have an input text field and submit button.

how do i make the url entered into the textfiel

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

How to read posted binary data from a mobile device and post it to a web server?
Here is the senario...

I have a mobile device (MD) that posts binary data to a Web Server (WS

ALV sum various columns problem
Hi all,
I'm doing a report on ABAP for a timesheet of the current month. The output i want is s

Filtering Tables
Hello Thanks for any help any one can give Im very new to PHP..

I need to pull data for clien

Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon

str_replace help
Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean

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