PHP GD mapping problem, please Daniel Help. Feel very simple, but I too food, do not understand

Source: Internet
Author: User
The code is as follows
 
  


This imagefill is populated from the second third parameter, the x, y coordinates, but why is the entire PNG populated?


Reply to discussion (solution)

The second and third parameters of the Imagefill are a point in the filled area
This point spreads around as a seed (originating point)
Can you understand?

The second and third parameters of the Imagefill are a point in the filled area
This point spreads around as a seed (originating point)
Can you understand?


So how can we just fill in a part of it?

Imagefilledarc--Draw an elliptical arc and fill
Imagefilledarc--Draw an elliptical arc and fill
Imagefilledpolygon--Draw a polygon and fill
Imagefilledrectangle--Draw a rectangle and fill
Imagefilltoborder--The area fills the boundary of the specified color

Imagefilledarc--Draw an elliptical arc and fill
Imagefilledarc--Draw an elliptical arc and fill
Imagefilledpolygon--Draw a polygon and fill
Imagefilledrectangle--Draw a rectangle and fill
Imagefilltoborder--The area fills the boundary of the specified color

Can you tell me about Imagefill? The diffusion you're talking about is just smattering.

Don't you read the manual?
There are sample codes in the manual

Don't you read the manual?
There are sample codes in the manual

Imagefill () performs an area fill with a color color at the coordinates x, y (0, 0) of the image image (that is, the same as x, Y point color, and adjacent points are populated). It's written in the manual, and I don't see it.

Not that, dot (x, y) is a seed, and of course the seed will only breed the same offspring.
If the point (x, y) is red, then the red dots adjacent to him will be changed.

This is your own move, and meditation alone is not understandable.

$im = Imagecreatetruecolor (+), $white = Imagecolorallocate ($im, 255, 255, 255); $red = Imagecolorallocate ($im, 255, 0 , 0); $green = imagecolorallocate ($im, 0, 255, 0); $blue = imagecolorallocate ($im, 0, 0, 255); Imagefill ($im, 0, 0, $white); I Magerectangle ($im, $red), Imagefill ($im, Wuyi, $green), Imagepng ($im);

This is your own move, and meditation alone is not understandable.

$im = Imagecreatetruecolor (+), $white = Imagecolorallocate ($im, 255, 255, 255); $red = Imagecolorallocate ($im, 255, 0 , 0); $green = imagecolorallocate ($im, 0, 255, 0); $blue = imagecolorallocate ($im, 0, 0, 255); Imagefill ($im, 0, 0, $white); I Magerectangle ($im, $red), Imagefill ($im, Wuyi, $green), Imagepng ($im);

Yes, I got it.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.