Using The Image Editing Functions Of Php - Specifically, lines or regular polygons.

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Using The Image Editing Functions Of Php - Specifically, lines or regular polygons.

beeseven
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?

Reply

beeseven
Done a little copying recently?

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

Notice from snlildude87:
Copied post deleted

Reply

Mike
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...

Reply

mobious
with the GD module loaded as a PHP extension, PHP gains image-editing functions.

Reply

beeseven
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);
?>

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. cache:w4upuxxxakoj:www.trap17.com/index.php/wappys-php-snippets_t38482.html >> enter your keyword - 649.49 hr back. (1)
Similar Topics

Keywords : image, editing, functions, php, specifically, lines, regular, polygons

  1. Defining Regular Expressions
    some tips.... (0)
  2. Testing Of The Auto Image Resizer
    This might be useful for other members also! (0)
    This is a test to see what image sizes are accepted on the Trap17 forums without the auto-resizer
    script kicking in. The first image is a 500 x 500 pixels size. Next up is a 700 x 300 pixels
    size image. And now a 900 x 100 pixels image. Okay, now let's try a 600 x 400 pixels
    image. Hmm, interesting. What about 600 x 500 pixels? Okay, good, now how about 650 x 650
    pixels? Nope, too much. Let's try 650 x 500 pixels. Ah, the old 640 trick! Let's
    try 640x500 instead... Okay, maximum width found as 640 pixels. Lets go for the height,....
  3. Finding The Rgb Color Of An Image
    Using any programming language (3)
    hello friends i am doing a project , in that i am inneed to fine the mean RGB value of a particular
    image , is there any program in any language which can do this ? the input to the program will be
    any image ( can be linked in the program) and the putput must be the mean RGB value of that
    particular image , is this Possible ? If so please post the Coding , no matter in what ever language
    it may be written.Thanks in Advance....
  4. How To Open Control Panel In Just My Regular Browser
    (2)
    I'm able to access the control panel when I use a proxy server, but proxies can't handle all
    scripts and such. Why can't I access the control panel in firefox or internet explorer. Whenever
    I click on the link it just times out.....
  5. Editing Posts Alters Credits?
    Does being retrospecitvely pedantic pay? (24)
    I am wondering about the Credit System calculations on the Trap17 forums. If I were to make a post
    and submit it, then the calculation system does its magic and attributes a certain number of Credits
    for that post, right? So, what happens if I later revisit the post and edit it? For argument's
    sake, if I get am a bit sloppy in my speeling and don't rite proper Inglish, then your algorithm
    will give me less Credits than if I had been more accurate with my spelling and grammar. However, if
    after I have pressed the "Post New Topic" or "Add Reply" button I notice the....
  6. Need Help About Regular Expressions
    (8)
    Hi, In my website, I don't want to allow writing links to another sites but except some sites.
    CODE //This is the text which is sent by the guest $variable='Some texts <a
    href="http://www.google.com/">Google</a><a
    href="http://www.microsoft.com/">Microsoft</a> '; //And the following
    line replaces all <a html tags to "no links allowed" text. $variable =
    preg_replace("!<a[^>]*(http|www|mailto)(.*)</a>&
    #33;siU", "no link....
  7. How To Make Image Buttons Act As Submit Button
    (8)
    Hi guys I m making a personal website .... I asked in the forum how to create and use images as
    buttons...thanks for your help.. I can make them work as links....give some hovering effects
    etc...they work very well..untill I use them in forms and use them as SUBMIT or RESET button...when
    I do this nothing happens on clicking the image button... the code I use is like but there
    is problem in making them act as SUBMIT or RESET button. I have tried very hard to make it work, but
    didn't succeed .... I know html and CSS quite well but , don't know....Javascr....
  8. How To Create Cool Image Buttons
    (7)
    Hi guys ... I m making a personal site thats for me a nd my friend group. What I need is a tool
    which can make cool image buttons to use in my HTML pages. Is there any site which offers such
    software or the buttons itself for free. I would like to make them on my own, I just need to know
    the tool.I can't go for an expensive tool like photoshop or corel. So please suggest me a free
    tool. Thanks.......
  9. Render Request Please..
    need this image renderd please. (0)
    Hi, im realy new to photoshop and i realy suck at rendering /sad.gif" style="vertical-align:middle"
    emoid=":(" border="0" alt="sad.gif" /> so i was wondering if anybody could render this image for me
    please Thank you so much for whoever does it. /smile.gif" style="vertical-align:middle"
    emoid=":)" border="0" alt="smile.gif" />....
  10. Problem Aligning In Firefox
    Problem aligning an image in Firefox. (9)
    Hello everyone! I am new here. /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> I am looking for some advice...I've been fiddling around with my site for
    the last few hours and have had no luck! www.thelatency.com/test/tour_dates.php as you can the
    image header above all the text is aligned perfectly in IE and not in Firefox. Any ideas? Thanks
    so much in advance. /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"
    />....
  11. Perl Regular Expresions Regex
    Learn how to use regular expressions (2)
    I've searched the Tutorials section, but haven't found a RegEx tutorial, so I thought
    I'd add one, since it's very usefull to know regular expressions if you're a
    programmer... If I overlooked a tutorial explaining RegEx, my bad, just erase this tutorial... Ok,
    first off, regular expressions are a great functionality of Perl, but the can also be found in other
    languages and environments, such as linux shells, or PHP... I'm guessing most people would be
    interesten in useing regular expressions in PHP... Let's go on with a complex matching reg....
  12. Help With Some Editing
    (5)
    Hi I shot a pic .. I am attaching a resized version. Now I just want the red colour and want
    everything else in black and white.. Does anyone know how to do that Thanks....
  13. Best Video Editing Software
    (8)
    Its really distracting seeing people "create" what they think are master pieces on windows movie
    maker. Its the lamest and really requires no skill. So im gunna whack my vote on Adobe Premiere Pro
    2 and Adobe After Affects 7 combined to make the best in the video editing range. It requires stacks
    of skills, you can download plenty of add-on effects and you can futher mod it if you wish in After
    Affects. These versions are one behind in the Adobe range since Adobe released its CS3 Prefix to all
    their newly upgraded versions. The new CS3 Prefixed Premiere is now compatibl....
  14. Functions
    ??? (9)
    I created this topic mainly because I wanna get a clear interpretation about those listed PHP
    functions. The first function is while($row=mysql_fetch_array($query)) { ....
  15. Recomend Me Some Software, Pleaes.
    (video editing and capturing) (17)
    Hey guys, Sorry if this isn't in an appropriate section it's kinda difficult to navigate
    all the sections to find one that suits each issue, and from what I can tell there isn't a
    general " ask questions here about random stuff" section. I'm sure almost everyone here has
    been on YouTube, Google video, or a site like those that contain tutorials for photo shop,
    programing, or anything else that you can find on your computer. I was wondering if you guys knew
    what kind of software they use? I'm looking to take video of me working on my computer....
  16. Cameraphones... Which Is Best?
    PocketPC, Smartphone, regular cellphone... the options and variation (18)
    I am currently using my PocketPC as my all around device. I no longer carry my old 2.2 mega pixel
    bulky camera (Kodak DX3600). It's too bulky and the delay really sucks. My AT&T 8525 has a 2
    mega pixel camera, records audio and video as well as all the other neat things like the full slide
    out qwerty keyboard, touchscreen, web browser, and runs Windows Mobile 5.0. Too bad I can't
    install Linux on it yet /wink.gif" style="vertical-align:middle" emoid=";)" border="0"
    alt="wink.gif" /> Well, back on topic: cameras. I just got back from a trip to Haw....
  17. Lemonade Scones
    .....easier than regular scones (1)
    LEMONADE SCONES Even I can make these. Why not have a go and let me know how you went. Makes 12
    to 15 scones INGREDIENTS 3 cups self-raising flour ½ tsp salt 300ml pouring cream 3/4 cup
    lemonade (NOT home-made) STEP 1 Sift the flour and salt into mixing bowl. Make a well in the
    centre. Pour the cream and lemonade into the well. Mix with a knife drawing the flour from the sides
    of the bowl to combine with the liquid. STEP 2 It's ready when the mixture forms a soft
    dough. Do not over mix. STEP 3 Remove the dough from the bowl and put it on a....
  18. Video Editing Software
    (11)
    I am looking for a free, decent video editing software. It does not need a lot of features. But I
    would like it to have the "slicing options", so I can split/cut films. I would also like it to have
    a simple intro option, just making simple intros with text. And the last thing, this is really
    important so listen up: It must not require my computer to have sound. I messed something up, so the
    sound is not working. This is causing my Windows Movie Maker not to work - since it requires some
    stuff. I know that I should fix this, but I will be getting a new laptop in a few mon....
  19. Php Functions To Send Mail
    (9)
    Which other methods to send mail from a form? I just know mail function, like: mail(string to,
    string subject, string message) Has anyother?....
  20. Background Image Swap Script
    Change a Background Image based on clock time (15)
    Background Image Changer Script To swap the background image from your CSS file according to the
    Server Clock Time. 1.) In your CSS file, add the following rule: CODE body {
        background: url(time.png); } 2.) Create a "folder" named time.png. 3.) Into the
    folder, place three images named morning.png, day.png, night.png. 4.) Also, in the same folder,
    create an index.php file and copy/paste the following script. CODE <?php $hour =
    date('H'); if ($hour < 12 ) {     $image =
    "morning.png"; } ....
  21. Do You Use Imagefilez.com?
    ImageFilez.com : Free Image and Video Hosting (36)
    Do you use ImageFilez.com? If so, for what and how long? If not, why? /huh.gif"
    style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /> Please vote and reply to
    this thread with your responses. I don't personally, because I have an account on Photobucket
    and ImageShack, and I sometimes use the Free Hosting that comes embedded into my forum and at the
    site I moderate.....
  22. Editing Or Modifying Joomla For A Beginner
    Php Help... Joomla related. (4)
    I have this code already existing... (index.php) id ) { initEditor(); } ?> " /> " ; ?> " ;
    ?> .... .... and it goes on. i am told to add this code in the head section...
    /modules/mod_smo_ajax_shoutbox_css.php" type="text/css" /> <script type="text/javascript" src="
    /modules/mod_smo_ajax_shoutbox_js.php"> I don't know much about PHP, but I don't see a
    incorporated in the index.php and I am not sure how to add the code. Anyone help out? Last warning
    notice** Topic title is IMPORTANT! ....
  23. Need To Shrink The File Size Of Web Image? - Photoshop Tricks
    (3)
    QUOTE NEED TO SHRINK THE FILE SIZE? USE TRANSPARENCY Want a killer tip for squeezing even
    more size out of your GIF Web images? Make something transparent. That's right, if you can pick
    an area of your image to make transparent, your file size will drop like a rock. For example, if
    you're putting a logo over a white background and you can make the white area around the logo
    transparent, your file size will be significantly smaller. The transparent areas are virtually
    ignored when determining file size, because, after all, there's nothing there. ....
  24. Scrolling Images?
    How to Make an Image Scroll With the Page (5)
    I'm trying to make my homepage look a little fancier and I've got a nice background image,
    but I want it to scroll with my page, like if you scroll down the image will still appear like it
    does on the top of the page. Can someone tell me how to do this? I'm using Microsoft Frontpage
    to edit it. I'm not sure what programming language this would be, probably CSS or Javascript,
    but I can edit the page script with Notepad or something to make this work. Right now the page is
    purely HTML, so whichever language this is, can somebody also give me the tags and ma....
  25. Wmp (windows Media Photo) - The New Image File Format From Microsoft
    windows media photo WMP - could replace JPGs and GIFs? (33)
    Microsoft have decided to come up with a new image format to add to the common JPGs, GIFs and PNGs
    of today. It is to be called Windows Media Photo format or WMP for short. It is said to
    "Surpass the limitations of existing file formats" and here is what it'll offer: Numerous
    colour formats for printing and displaying High-quality lossy or even lossless compression
    Really efficient decoding for numerous resolutions For more features, visit
    http://www.microsoft.com/whdc/xps/wmphoto.mspx Presumeably, the JPEG2000 format or JP2 was
    ....
  26. How To Create Embed Image Mail In Gmail
    (56)
    Hi to all ! Anybody can help me to create an email with embedded image so that mail reader
    automatically see that image. Moreover I wont attached that image as it appears small in size in on
    gmail. Thanks in Advance. ....
  27. Watermark Your Image With Simple Php Script
    found it on the net (35)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked
    image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly
    transparent gif image with the watermark - goes in the same directory as this script // ....
  28. Visual Basic 6.0 Help Needed
    Adding lines to a textbox without delete (15)
    I need help with Visual Basic 6.0 and adding lines to a textbox without deleting any previous
    lines.. I've gotten as far as finding a way to add the lines, but it deletes the prevous entree.
    Help is appreciated!....
  29. Google Earth Easter Egg
    stuff not usually there on regular maps (10)
    Well while i was exploring the area near the colorado river ( i think!) i kinda saw a long line
    of arabic language all over the map stretching all over the place has anyone seen this things? also
    i saw this arabic lines near North Korea at the mountanious ( forgot how to spell it) area. Has
    anyone seen the lines anywhere else There's also a crop circle on one of the USA maps if you
    look closely enough....
  30. Image Preloader With Progress Bar Status
    Pure Client-Side JavaScript tested in 4 Browsers! (23)
    Tutorial: Image Preloader with Progress Bar, by Rob J. Secord, B.Sc. (SystemWisdom)
    Description : A Tutorial for a Client-Side Image Preloader with Dynamic Real-Time Progress Bar
    Indicator written in JavaScript! Tested to work with 4 Major Internet Browsers: Firefox, MSIE,
    Netscape, Opera (Complete sample solution provided at end of tutorial, just put it on your
    web-server, add your images and go!) Intended Audience : Beginner to Intermediate Web
    Developers. Although this tutorial will cover some advanced aspects of JavaScript, I will try to
    explain....

    1. Looking for image, editing, functions, php, specifically, lines, regular, polygons

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for image, editing, functions, php, specifically, lines, regular, polygons

*MORE FROM TRAP17.COM*
Similar
Defining Regular Expressions - some tips....
Testing Of The Auto Image Resizer - This might be useful for other members also!
Finding The Rgb Color Of An Image - Using any programming language
How To Open Control Panel In Just My Regular Browser
Editing Posts Alters Credits? - Does being retrospecitvely pedantic pay?
Need Help About Regular Expressions
How To Make Image Buttons Act As Submit Button
How To Create Cool Image Buttons
Render Request Please.. - need this image renderd please.
Problem Aligning In Firefox - Problem aligning an image in Firefox.
Perl Regular Expresions Regex - Learn how to use regular expressions
Help With Some Editing
Best Video Editing Software
Functions - ???
Recomend Me Some Software, Pleaes. - (video editing and capturing)
Cameraphones... Which Is Best? - PocketPC, Smartphone, regular cellphone... the options and variation
Lemonade Scones - .....easier than regular scones
Video Editing Software
Php Functions To Send Mail
Background Image Swap Script - Change a Background Image based on clock time
Do You Use Imagefilez.com? - ImageFilez.com : Free Image and Video Hosting
Editing Or Modifying Joomla For A Beginner - Php Help... Joomla related.
Need To Shrink The File Size Of Web Image? - Photoshop Tricks
Scrolling Images? - How to Make an Image Scroll With the Page
Wmp (windows Media Photo) - The New Image File Format From Microsoft - windows media photo WMP - could replace JPGs and GIFs?
How To Create Embed Image Mail In Gmail
Watermark Your Image With Simple Php Script - found it on the net
Visual Basic 6.0 Help Needed - Adding lines to a textbox without delete
Google Earth Easter Egg - stuff not usually there on regular maps
Image Preloader With Progress Bar Status - Pure Client-Side JavaScript tested in 4 Browsers!
advertisement



Using The Image Editing Functions Of Php - Specifically, lines or regular polygons.



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE