←选择平台

PremultiplyAlphaValuesCommand类

总结
将图像数据从自左乘或α值。
语法
c#
VB
objective - c
c++
Java
公共PremultiplyAlphaValuesCommand:RasterCommand
公共PremultiplyAlphaValuesCommand继承了RasterCommand
@接口LTPremultiplyAlphaValuesCommand: LTRasterCommand
公共PremultiplyAlphaValuesCommand扩展RasterCommand
公共ref类PremultiplyAlphaValuesCommand:公共RasterCommand
讲话

此命令仅适用于图像32或64位比特每像素。

例子

这个例子将加载一个32位PNG图像,然后将数据转换为自左乘α值。

c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.ImageProcessing;公共无效PremultiplyAlphaValuesCommandExample (){RasterCodecs编解码器=RasterCodecs ();字符串srcFileName = Path.Combine (LEAD_VARS.ImagesDir,“LittleGFlyingAlpha.png”);字符串destFileName = Path.Combine (LEAD_VARS.ImagesDir,“PremultiplyAlphaValuesCommand.bmp”);/ /加载从磁盘源图像RasterImage图像= codecs.Load (srcFileName);Debug.Assert(图片。BitsPerPixel = = 32);/ /图像数据转换为自左乘α值PremultiplyAlphaValuesCommand cmd =PremultiplyAlphaValuesCommand ();cmd。ConvertToPremultipliedValues =真正的;cmd.Run(图片);/ /保存图片回磁盘编解码器。保存(图像、destFileName RasterImageFormat。Bmp、32);/ /清理image.Dispose ();codecs.Dispose ();}静态LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;}
进口Leadtools进口Leadtools.Codecs进口Leadtools.ImageProcessing公共PremultiplyAlphaValuesCommandExample ()昏暗的编解码器作为RasterCodecs =RasterCodecs ()昏暗的srcFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“LittleGFlyingAlpha.png”)昏暗的destFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“PremultiplyAlphaValuesCommand.bmp”)“从磁盘加载源图像昏暗的图像作为RasterImage = codecs.Load (srcFileName)Debug.Assert(图片。BitsPerPixel = 32)的图像数据转换为自左乘α值昏暗的cmd作为PremultiplyAlphaValuesCommand =PremultiplyAlphaValuesCommand ()cmd。ConvertToPremultipliedValues =真正的cmd.Run(图片)“回磁盘保存图像编解码器。保存(图像、destFileName RasterImageFormat。Bmp、32)的清理image.Dispose ()codecs.Dispose ()结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

Leadtools组装