![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
imagecreatetruecolor() function in PHP
The imagecreatetruecolor() function creates a new true color image.
Syntax
imagecreatetruecolor (width , height )
Parameters
width: The image width.
height: The image height.
Return
The imagecreatetruecolor() function returns an image resource identifier on success, FALSE on errors.
Example
The following is an example
<?php $img = imagecreatetruecolor(600, 500); echo imagesy($img); echo "<br>"; echo imagesx($img); ?>
Output
The following is the output displaying the height and width of the new image:
500 600
Example
Let us see another example with different height and width:
<?php $img = imagecreatetruecolor(300, 450); echo imagesy($img); echo "<br>"; echo imagesx($img); ?>
Output
The following is the output displaying the height and width of the new image:
450 300
Advertisements