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

natcasesort works on one server but not on another
Hi

I have a problem that I was hoping that someone can help me with.

I'm trying to use

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

Change of partner analyse in sales orders
Hello,

I changed the partner analyse for sales orders and added a new mandatory partnerro

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

i have no idea why this isn't working
Code: <?php
session_start();
include("connect.php");

error_reporting(E

How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.
But w

How to assign a textbox value to PHP variable??
Hi ! Can any one help me out as quickly as possible. As I m new to PHP.
Plz tell me how to assign

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

Disabling SAP menu
How do I disable SAP menu for all the users and just restrict them to User Menu in SAP ECC 6.0?

help with contest script
I would like to code a contest script to my site but i don't know how. Could someone just give me pu

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