LEADTOOLS画像処理(Leadtools.ImageProcessing.Effectsアセンブリ)

フレームを表示

TextureAlphaBlendCommandクラス








メンバ 
フェザリングと恒常的な不透明度で2つのイメージから画像データを結合します;組み合わさることによって、その後フェーディングマスクに依存する様々な不透明度による2つのイメージは、恒常的な不透明度で結果をデスティネーションimageと結合します。
オブジェクトモデル
構文
'Declaration
 
Public Class TextureAlphaBlendCommand 
   Inherits Leadtools.ImageProcessing.RasterCommand
   Implements Leadtools.ImageProcessing.IRasterCommand 
'Usage
 
Dim instance As TextureAlphaBlendCommand
public sealed class TextureAlphaBlendCommand : Leadtools.ImageProcessing.IRasterCommand  
function Leadtools.ImageProcessing.Effects.TextureAlphaBlendCommand()
public ref class TextureAlphaBlendCommand : public Leadtools.ImageProcessing.RasterCommand, Leadtools.ImageProcessing.IRasterCommand  
解説
詳細については、「LEADTOOLSによる画像処理入門」を参照してください。
詳細については、「アートエフェクトの適用」を参照してください。
サンプル

imageの上でTextureAlphaBlendCommandを実行します。

Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Effects

   
Public Sub TextureAlphaBlendCommandExample()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True
   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"))

   ' Prepare the command
   Try
      Dim SrcImage As RasterImage
      Dim MaskImage As RasterImage
      Dim underlayImage As RasterImage
      SrcImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "image2.cmp"), 24, CodecsLoadByteOrder.Bgr, 1, 1)
      'Load the fade mask image.
      MaskImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ImageProcessingDemo\image3.cmp"), 24, CodecsLoadByteOrder.Bgr, 1, 1)
      underlayImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"), 4, CodecsLoadByteOrder.Bgr, 1, 1)
      Dim command As TextureAlphaBlendCommand = New TextureAlphaBlendCommand
      command.DestinationRectangle = New LeadRect(0, 0, leadImage.Width, leadImage.Height)
      command.MaskImage = MaskImage
      command.Opacity = 100
      command.SourceImage = SrcImage
      command.UnderlayImage = underlayImage
      command.SourcePoint = New LeadPoint(0, 0)
      ' Combine ImageSource with the affected image, with MaskImage and a 100 opacity.
      command.Run(leadImage)
      codecs.Save(leadImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24)

   Catch ex As Exception
      MessageBox.Show(ex.Message, "TextureAlphaBlendTest", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
   End Try

End Sub

Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Effects;

      
public void TextureAlphaBlendCommandExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"));

   // Prepare the command
   RasterImage SrcImage;
   RasterImage MaskImage;
   RasterImage underlayImage;

   SrcImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\Image3.cmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1);
   //Load the fade mask image.
   MaskImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\FadeMask.bmp"), 4, CodecsLoadByteOrder.Bgr, 1, 1);

   underlayImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"), 4, CodecsLoadByteOrder.Bgr, 1, 1);

   TextureAlphaBlendCommand command = new TextureAlphaBlendCommand();
   command.DestinationRectangle = new LeadRect(image.Width / 2 - MaskImage.Width / 2, image.Height / 2  - MaskImage.Height / 2, MaskImage.Width, MaskImage.Height);
   command.MaskImage = MaskImage;
   command.Opacity = 100;
   command.SourceImage = SrcImage;
   command.SourcePoint = new LeadPoint(0, 0);
   command.UnderlayImage = underlayImage;
   // Combine ImageSource with the affected image, with MaskImage and a 100 opacity.
   command.Run(image);
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24);

}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Effects;
using Leadtools.ImageProcessing;

      
public async Task TextureAlphaBlendCommandExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   string srcFileName = @"Assets\Master.jpg";
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

   // Prepare the command
   RasterImage srcImage;
   RasterImage maskImage;
   RasterImage underlayImage;

   srcFileName = @"Assets\Image3.cmp";
   loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   srcImage = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile), 4, CodecsLoadByteOrder.Bgr, 1, 1);

   //Load the fade mask image.
   srcFileName = @"Assets\FadeMask.bmp";
   loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   maskImage = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile), 4, CodecsLoadByteOrder.Bgr, 1, 1);

   //Load the underlay image.
   srcFileName = @"Assets\cannon.jpg";
   loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   underlayImage = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile), 4, CodecsLoadByteOrder.Bgr, 1, 1);

   TextureAlphaBlendCommand command = new TextureAlphaBlendCommand();
   command.DestinationRectangle = LeadRectHelper.Create(image.Width / 2 - maskImage.Width / 2, image.Height / 2 - maskImage.Height / 2, maskImage.Width, maskImage.Height);
   command.MaskImage = maskImage;
   command.Opacity = 100;
   command.SourceImage = srcImage;
   command.SourcePoint = LeadPointHelper.Create(0, 0);
   command.UnderlayImage = underlayImage;
   // Combine ImageSource with the affected image, with MaskImage and a 100 opacity.
   command.Run(image);

   string destFileName = @"result.bmp";
   StorageFile saveFile = await Tools.AppLocalFolder.CreateFileAsync(destFileName);
   await codecs.SaveAsync(image, LeadStreamFactory.Create(saveFile), RasterImageFormat.Bmp, 24);
}
必要条件

ターゲットプラットホーム

参照

参照

TextureAlphaBlendCommandメンバ
Leadtools.ImageProcessing.Effects名前空間
LEADTOOLSによる画像処理入門
アートエフェクトの適用
CombineCommandクラス
AlphaBlendCommandクラス
FeatherAlphaBlendCommandクラス
Leadtools.ImageProcessing.SpecialEffects.BricksTextureCommand
Leadtools.ImageProcessing.SpecialEffects.CanvasCommand
DisplacementCommandクラス
Leadtools.ImageProcessing.SpecialEffects.FragmentCommand
Leadtools.ImageProcessing.SpecialEffects.VignnetCommand
Leadtools.ImageProcessing.SpecialEffects.CanvasCommand
Leadtools.ImageProcessing.SpecialEffects.CloudsCommand
Leadtools.ImageProcessing.SpecialEffects.ColoredBallsCommand
Leadtools.ImageProcessing.SpecialEffects.DiffuseGlowCommand
DisplacementCommandクラス
Leadtools.ImageProcessing.SpecialEffects.FragmentCommand
Leadtools.ImageProcessing.Core.HalfTonePatternCommand
MaskConvolutionCommandクラス
Leadtools.ImageProcessing.SpecialEffects.MosaicTilesCommand
OffsetCommandクラス
Leadtools.ImageProcessing.SpecialEffects.PerspectiveCommand
Leadtools.ImageProcessing.SpecialEffects.PlasmaCommand
Leadtools.ImageProcessing.SpecialEffects.PointillistCommand
Leadtools.ImageProcessing.SpecialEffects.RomanMosaicCommand
Leadtools.ImageProcessing.SpecialEffects.VignnetCommand
Leadtools.ImageProcessing.SpecialEffects.ZigZagCommand