PHP GD Library

Creating a PNG with a TrueType font

<?php

header("Content-type: image/png");

$im = ImageCreate(630,80);

$blue = ImageColorAllocate($im,0x5B,0x69,0xA6);

$white = ImageColorAllocate($im,255,255,255);

$black = ImageColorAllocate($im,0,0,0);

ImageTTFText($im, 45, 0, 10, 57,$black,"Times",$_GET['text']);

ImageTTFText($im, 45, 0, 6, 54,$white,"Times",$_GET['text']);

ImagePNG($im);

?>

<img src="txt.php?text=<?php echo strip_tags(urlencode($_GET['text'])); ?>">

 


Loading ...

Related Results :

  1. [How-to] Setup Custom full root or Sub-Domain for Profile and Course
  2. Introduction to HTML
  3. HTML Basic Tags and Elements
  4. HTML Attributes
  5. HTML Formatting
  6. HTML Phrase Formatting
  7. HTML Comment Tags
  8. HTML Meta and OG (Opengraph) Tags
  9. HTML Images
  10. HTML Tables
  11. HTML Lists
  12. Introduction to Python
  13. Variables and Types
  14. Lists, Tuples & Dictionary
  15. Basic Operators
  16. If else-elif else nested if Statement
  17. For & While Loops
  18. String Formatting
  19. Functions in Python
  20. Basic String Operations
  21. Classes and Objects
  22. self in python class
  23. Built-In & More Classes & Objects
  24. Modules and Packages
  25. Introduction to CSS
  26. CSS Syntax & Selectors
  27. Include CSS
  28. CSS Measuring Units
  29. CSS Colors
  30. CSS - Background
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of w3clan.com.
  • Any registered user can create related posts based on search term tags.

About the Author