ImageTask(Image, Boolean, ImageUltimateConfiguration) Constructor

Initializes a new instance of the ImageTask class from the specified Image.

Definition

Namespace: GleamTech.ImageUltimate
Assembly: GleamTech.ImageUltimate (in GleamTech.ImageUltimate.dll) Version: 6.2.0
C#
public ImageTask(
	Image image,
	bool enableUndo = false,
	ImageUltimateConfiguration configuration = null
)

Parameters

image  Image
The Image instance containing the image to load.
enableUndo  Boolean  (Optional)
If you need to use Undo and UndoAll commands, this parameter should be set to true.
configuration  ImageUltimateConfiguration  (Optional)
The configuration to use instead of the global configuration.

Example

Casting from/to System.Drawing.Bitmap and System.Drawing.Image:

C#
GleamTech.Drawing.Image image;
var sdBitmap = new System.Drawing.Bitmap("Test.bmp");
var sdImage = System.Drawing.Image.FromFile("Test.jpg");

//Casting from System.Drawing.Bitmap:
//Use extension method ToGleamTechDrawingImage
image = sdBitmap.ToGleamTechDrawingImage();
//Or use explicit casting
image = (GleamTech.Drawing.Image)sdBitmap;

//Casting to System.Drawing.Bitmap:
//Use extension method ToSystemDrawingBitmap
sdBitmap = image.ToSystemDrawingBitmap();
//Or use explicit casting
sdBitmap = (System.Drawing.Bitmap)image;

//---------------------------------------

//Casting from System.Drawing.Image:
//Use extension method ToGleamTechDrawingImage
image = sdImage.ToGleamTechDrawingImage();
//Or use explicit casting
image = (GleamTech.Drawing.Image)sdImage;

//Casting to System.Drawing.Image:
//Use extension method ToSystemDrawingImage
sdImage = image.ToSystemDrawingImage();
//Or use explicit casting
sdImage = (System.Drawing.Image)image;

Casting from/to SixLabors.ImageSharp.Image:

C#
//Casting from SixLabors.ImageSharp.Image:
//Use extension method ToGleamTechDrawingImage
image = sisImage.ToGleamTechDrawingImage();
//Or use explicit casting
image = (GleamTech.Drawing.Image)sisImage;

//Casting to SixLabors.ImageSharp.Image:
//Use extension method ToImageSharpImage
sisImage = image.ToImageSharpImage();
//Or use explicit casting
sisImage = (SixLabors.ImageSharp.Image)image;

Casting from/to SkiaSharp.SKBitmap and SkiaSharp.SKImage:

C#
GleamTech.Drawing.Image image;
var skBitmap = SkiaSharp.SKBitmap.Decode("Test.bmp");
var skImage = SkiaSharp.SKImage.FromBitmap(skBitmap);

//Casting from SkiaSharp.SKBitmap:
//Use extension method ToGleamTechDrawingImage
image = skBitmap.ToGleamTechDrawingImage();
//Or use explicit casting
image = (GleamTech.Drawing.Image)skBitmap;

//Casting to SkiaSharp.SKBitmap:
//Use extension method ToSkiaSharpBitmap
skBitmap = image.ToSkiaSharpBitmap();
//Or use explicit casting
skBitmap = (SkiaSharp.SKBitmap)image;

//---------------------------------------

//Casting from SkiaSharp.SKImage:
//Use extension method ToGleamTechDrawingImage
image = skImage.ToGleamTechDrawingImage();
//Or use explicit casting
image = (GleamTech.Drawing.Image)skImage;

//Casting to SkiaSharp.SKImage:
//Use extension method ToSkiaSharpImage
skImage = image.ToSkiaSharpImage();
//Or use explicit casting
skImage = (SkiaSharp.SKImage)image;

Casting from/to Microsoft.Maui.Graphics.Platform.PlatformImage:

C#
GleamTech.Drawing.Image image;
var mgImage = new Microsoft.Maui.Graphics.Platform.PlatformImage(imageBytes);

//Casting from Microsoft.Maui.Graphics.Platform.PlatformImage:
//Use extension method ToGleamTechDrawingImage
image = mgImage.ToGleamTechDrawingImage();
//Or use explicit casting
image = (GleamTech.Drawing.Image)mgImage;

//Casting to Microsoft.Maui.Graphics.Platform.PlatformImage:
//Use extension method ToMauiGraphicsImage
mgImage = image.ToMauiGraphicsImage();
//Or use explicit casting
mgImage = (Microsoft.Maui.Graphics.Platform.PlatformImage)image;

See Also