imagescreatetruecolor with a white background

后端 未结 3 1615
半阙折子戏
半阙折子戏 2020-12-31 03:23

I\'m pretty sure I need to use imagefilledrectangle in order to get a white background instead of black on this... just not sure how. I\'ve tried a few ways.



        
3条回答
  •  既然无缘
    2020-12-31 03:58

    UPDATE (2020): Please see this answer below for a faster fill than imagefill: https://stackoverflow.com/a/32580839/1005039

    ORIGINAL

    From the PHP manual entry for imagefill:

    $image = imagecreatetruecolor(100, 100);
    
    // set background to white
    $white = imagecolorallocate($image, 255, 255, 255);
    imagefill($image, 0, 0, $white);
    

提交回复
热议问题