Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Using The Image Editing Functions Of Php, Specifically, lines or regular polygons.
beeseven
post May 7 2005, 12:56 AM
Post #1


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



I've been experimenting a little with PHP's image functions and I was trying to see if I could make something that looked 3D, so I started with a cube because it's simple. To make an isometric picture of a cube, you need to start with a regular hexagon. However, making a regular hexagon isn't the easiest thing. Is there a function to create a regular polygon, or specify an angle and magnitude for a vector?
Go to the top of the page
 
+Quote Post
beeseven
post May 8 2005, 01:57 AM
Post #2


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



Done a little copying recently?

http://www.phpbuilder.com/columns/cash20030526.php3

Notice from snlildude87:
Copied post deleted


This post has been edited by snlildude87: May 8 2005, 02:07 AM
Go to the top of the page
 
+Quote Post
Mike
post May 8 2005, 01:23 PM
Post #3


Owner of Sub-Zero
********

Group: Members
Posts: 159
Joined: 17-November 04
Member No.: 2,325



PHP has image editing functions?! >_>; I never even knew that. I mean, I knew it had tons of mail functions and all that good stuff but never image editing functions. The most recent thing that I have learned that have to do with shapes is something that you add in CSS. It's like this:

CODE


-moz-border-radius: #px;



I had no idea you could edit pictures with PHP...
Go to the top of the page
 
+Quote Post
mobious
post May 9 2005, 08:01 AM
Post #4


Advanced Member
*******

Group: Members
Posts: 113
Joined: 14-January 05
From: Philippines
Member No.: 3,271



with the GD module loaded as a PHP extension, PHP gains image-editing functions.
Go to the top of the page
 
+Quote Post
beeseven
post May 10 2005, 12:49 AM
Post #5


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



Yeah, you can do stuff but it's pretty complicated. Here's an example:

http://www.tjhsst.edu/~tsmilack/tests/image.php

The code is:
CODE
<?php
header("Content-type: image/png");
$img = imagecreate(500,500);
$topleft = imagecolorallocate($img,255,0,0);
$bottomright = imagecolorallocate($img,255,255,0);
$topright = imagecolorallocate($img,0,0,255);
$bottomleft = imagecolorallocate($img,0,255,0);
$middle = imagecolorallocate($img,255,0,255);
$border = imagecolorallocate($img,0,0,0);
$diamond = imagecolorallocate($img,255,128,0);
imagefilledrectangle($img,0,0,250,250,$topleft);
imagefilledrectangle($img,250,0,500,250,$topright);
imagefilledrectangle($img,0,250,250,500,$bottomleft);
imagefilledrectangle($img,250,250,500,500,$bottomright);
imagefilledrectangle($img,125,125,375,375,$middle);
$points = array(125,250,250,125,375,250,250,375);
imagefilledpolygon($img,$points,4,$diamond);
imagerectangle($img,0,0,499,499,$border);
imagepng($img);
imagedestroy($img);
?>
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Password Encryption With Hash Functions(3)
  2. Image Upload To Cutenews(2)
  3. Do You Use Imagefilez.com?(36)
  4. Defining Regular Expressions(0)
  5. Editing Posts Alters Credits?(24)
  6. Testing Of The Auto Image Resizer(0)
  7. Finding The Rgb Color Of An Image(3)
  8. Wmp (windows Media Photo) - The New Image File Format From Microsoft(33)
  9. Functions(9)
  10. How To Open Control Panel In Just My Regular Browser(2)
  11. How To Create Embed Image Mail In Gmail(56)
  12. Cameraphones... Which Is Best?(18)
  13. Image Preloader With Progress Bar Status(23)
  14. Php Functions To Send Mail(9)
  15. Recomend Me Some Software, Pleaes.(17)
  1. How To Make Image Buttons Act As Submit Button(8)
  2. Need Help About Regular Expressions(8)
  3. How To Create Cool Image Buttons(7)
  4. Problem Aligning In Firefox(9)
  5. Visual Basic 6.0 Help Needed(15)
  6. Best Video Editing Software(8)
  7. Need To Shrink The File Size Of Web Image? - Photoshop Tricks(3)
  8. Render Request Please..(0)
  9. Watermark Your Image With Simple Php Script(35)
  10. Video Editing Software(11)
  11. Background Image Swap Script(15)
  12. Perl Regular Expresions Regex(2)
  13. Help With Some Editing(5)
  14. Editing Or Modifying Joomla For A Beginner(4)
  15. Google Earth Easter Egg(10)


 



- Lo-Fi Version Time is now: 13th October 2008 - 04:56 PM