doushi6947 2012-04-11 10:01
浏览 104
已采纳

在构造ImagickPixel时设置alpha通道

I am new to using ImageMagick. I am using the latest imagick extension (3.1.0rc1) with PHP. However, the documentation for imagick seems to be somewhat sparse.

I want to create an ImagickPixel object with an alpha channel. The documentation states that these are some valid color values to pass to the constructor: "blue", "#0000ff", "rgb(0,0,255)", "cmyk(100,100,100,10)", etc.

I know that it is possible to retrive the alpha value of an ImagickPixel using getColorValue(imagick::COLOR_ALPHA);.

So, how can I set an rgb color with an alpha channel during initialization of the object by passing to the constructor?

  • 写回答

2条回答 默认 最新

  • dongxi2163 2012-04-11 10:52
    关注

    Looks like the way to do it is to just use rgba:

    $myImagickPixel = new ImagickPixel("rgba(250,15,150,0)"); //Where the last digit is the alpha and 0 is transparent and 1 is fully opaque.
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 CSS实现渐隐虚线框
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容