本文整理匯總了Golang中github.com/ctripcorp/nephele/imgsvr/img4g.Image.Composite方法的典型用法代碼示例。如果您正苦於以下問題:Golang Image.Composite方法的具體用法?Golang Image.Composite怎麽用?Golang Image.Composite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/ctripcorp/nephele/imgsvr/img4g.Image
的用法示例。
在下文中一共展示了Image.Composite方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Process
func (this *WaterMarkProcessor) Process(img *img4g.Image) error {
l4g.Debug("process watermark")
var err error = nil
tran := this.Cat.NewTransaction(Image, "Watermark")
defer func() {
this.Logo.DestoryWand()
tran.SetStatus(err)
tran.Complete()
}()
this.Logo.CreateWand()
if this.Location == 0 {
this.Location = 9
}
if this.Location < 1 || this.Location > 9 {
err = errors.New("Logo location(" + string(this.Location) + ") isn't right!")
return err
}
var x, y int64
x, y, err = getLocation(this.Location, img, this.Logo)
if err != nil {
return err
}
if this.Dissolve > 0 && this.Dissolve < 100 {
this.Logo.Dissolve(this.Dissolve)
}
err = img.Composite(this.Logo, x, y)
return err
}