Applies a Leadtools.ImageProcessing.RasterCommand to the current image in order to process it.
public void ApplyCommand(
RasterCommand cmd
)
Public Sub ApplyCommand( _
ByVal cmd As RasterCommand _
)
public:
void ApplyCommand(
RasterCommand^ cmd
)
cmd
The Leadtools.ImageProcessing.RasterCommand to be applied to the image.
This example inverts the image and returns the inverted image into Leadtools.RasterImage object.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Web.Controls;
using Leadtools.ImageProcessing;
public void WebImageViewer_FlipCommand()
{
WebImageViewer mainWebImageViewer = new WebImageViewer();
FlipCommand cmd = new FlipCommand();
mainWebImageViewer.ImageDataChanged += new EventHandler(mainWebImageViewer_ImageDataChanged);
mainWebImageViewer.ApplyCommand(cmd);
mainWebImageViewer.ImageDataChanged -= new EventHandler(mainWebImageViewer_ImageDataChanged);
string imageUrl = mainWebImageViewer.ImageInfo.Url;
if (mainWebImageViewer.ImageInfo.CacheFileName != string.Empty)
imageUrl = mainWebImageViewer.ImageInfo.CacheFileName;
RasterCodecs codecs = new RasterCodecs();
string filePath = mainWebImageViewer.Page.MapPath(imageUrl);
int pageNumber = mainWebImageViewer.ImageInfo.PageIndex + 1;
RasterImage image = codecs.Load(filePath, 0, CodecsLoadByteOrder.BgrOrGray, pageNumber, pageNumber);
}
void mainWebImageViewer_ImageDataChanged(object sender, EventArgs e)
{
// "Image Data changed"...
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.Web.Controls
Public Sub WebImageViewer_FlipCommand()
Dim mainWebImageViewer As WebImageViewer = New WebImageViewer()
Dim cmd As FlipCommand = New FlipCommand()
AddHandler mainWebImageViewer.ImageDataChanged, AddressOf mainWebImageViewer_ImageDataChanged
mainWebImageViewer.ApplyCommand(cmd)
RemoveHandler mainWebImageViewer.ImageDataChanged, AddressOf mainWebImageViewer_ImageDataChanged
Dim imageUrl As String = mainWebImageViewer.ImageInfo.Url
If (Not mainWebImageViewer.ImageInfo.CacheFileName = String.Empty) Then
imageUrl = mainWebImageViewer.ImageInfo.CacheFileName
End If
Dim codecs As RasterCodecs = New RasterCodecs()
Dim filePath As String = mainWebImageViewer.Page.MapPath(imageUrl)
Dim pageNumber As Integer = mainWebImageViewer.ImageInfo.PageIndex + 1
Dim image As RasterImage = codecs.Load(filePath, 0, CodecsLoadByteOrder.BgrOrGray, pageNumber, pageNumber)
End Sub
Sub mainWebImageViewer_ImageDataChanged(ByVal sender As Object, ByVal e As EventArgs)
'' "Image Data changed"...
End Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document