Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Controls
Imports Leadtools.Dicom
Imports Leadtools.Drawing
Imports Leadtools.Svg
Public Sub OrderExample()
Dim codecs As RasterCodecs = New RasterCodecs()
Dim srcFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp")
' Load the image as BGR (default) and get the first pixel value
Dim image As RasterImage = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Bgr, 1, 1)
Console.WriteLine("Order is {0}", image.Order)
image.Dispose()
' Load the image as RGB and get the first pixel value
image = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Rgb, 1, 1)
Console.WriteLine("Order is {0}", image.Order)
image.Dispose()
codecs.Dispose()
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;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Dicom;
using Leadtools.Drawing;
using Leadtools.Controls;
using Leadtools.Svg;
public void OrderExample()
{
RasterCodecs codecs = new RasterCodecs();
string srcFileName = Path.Combine(ImagesPath.Path, "Image1.cmp");
// Load the image as BGR (default) and get the first pixel value
RasterImage image = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Bgr, 1, 1);
Console.WriteLine("Order is {0}", image.Order);
image.Dispose();
// Load the image as RGB and get the first pixel value
image = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Rgb, 1, 1);
Console.WriteLine("Order is {0}", image.Order);
image.Dispose();
codecs.Dispose();
}
RasterImageExamples.prototype.OrderExample = function () {
Tools.SetLicense();
var codecs = new Leadtools.Codecs.RasterCodecs();
var srcFileName = "Assets\\Image1.cmp";
// Load the image as BGR (default) and get the first pixel value
return Tools.AppInstallFolder().getFileAsync(srcFileName).then(function (loadFile) {
return codecs.loadAsync(Leadtools.LeadStreamFactory.create(loadFile), 24, Leadtools.Codecs.CodecsLoadByteOrder.bgr, 1, 1);
})
.then(function (image) {
console.info("Order is ", image.order);
image.close();
// Load the image as RGB and get the first pixel value
return Tools.AppInstallFolder().getFileAsync(srcFileName);
})
.then(function (loadFile) {
return codecs.loadAsync(Leadtools.LeadStreamFactory.create(loadFile), 24, Leadtools.Codecs.CodecsLoadByteOrder.rgb, 1, 1);
})
.then(function (image) {
console.info("Order is ", image.order);
image.close();
codecs.close();
});
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Dicom;
public async Task OrderExample()
{
RasterCodecs codecs = new RasterCodecs();
string srcFileName = @"Assets\Image1.cmp";
// Load the image as BGR (default) and get the first pixel value
StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile), 24, CodecsLoadByteOrder.Bgr, 1, 1);
Debug.WriteLine("Order is {0}", image.Order);
image.Dispose();
// Load the image as RGB and get the first pixel value
loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile), 24, CodecsLoadByteOrder.Rgb, 1, 1);
Debug.WriteLine("Order is {0}", image.Order);
image.Dispose();
codecs.Dispose();
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Dicom;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Examples;
using Leadtools.Windows.Media;
public void OrderExample()
{
// Create an image as BGR
RasterImage srcImage = new RasterImage(RasterMemoryFlags.Conventional, 300, 300, 24, RasterByteOrder.Bgr, RasterViewPerspective.TopLeft, null, null, 0);
Debug.WriteLine("Order is {0}", srcImage.Order);
Debug.Assert(srcImage.Order == RasterByteOrder.Bgr);
srcImage.Dispose();
// Create an image as RGB
srcImage = new RasterImage(RasterMemoryFlags.Conventional, 300, 300, 24, RasterByteOrder.Rgb, RasterViewPerspective.TopLeft, null, null, 0);
Debug.WriteLine("Order is {0}", srcImage.Order);
Debug.Assert(srcImage.Order == RasterByteOrder.Rgb);
srcImage.Dispose();
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Dicom
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Windows.Media
Public Sub OrderExample()
' Create an image as BGR
Dim srcImage As RasterImage = New RasterImage(RasterMemoryFlags.Conventional, 300, 300, 24, RasterByteOrder.Bgr, RasterViewPerspective.TopLeft, Nothing, Nothing, 0)
Debug.WriteLine("Order is {0}", srcImage.Order)
Debug.Assert(srcImage.Order = RasterByteOrder.Bgr)
srcImage.Dispose()
' Create an image as RGB
srcImage = New RasterImage(RasterMemoryFlags.Conventional, 300, 300, 24, RasterByteOrder.Rgb, RasterViewPerspective.TopLeft, Nothing, Nothing, 0)
Debug.WriteLine("Order is {0}", srcImage.Order)
Debug.Assert(srcImage.Order = RasterByteOrder.Rgb)
srcImage.Dispose()
End Sub