←Select platform

ConvertFromImageOptions Enumeration

Summary
Options to use when converting a GDI+ System.Drawing.Bitmap to LEADTOOLS Leadtools.RasterImage object.
Syntax
C#
C++/CLI
Python
[FlagsAttribute()] 
public enum ConvertFromImageOptions   
[FlagsAttribute()] 
public enum class ConvertFromImageOptions   
class ConvertFromImageOptions(Enum): 
   None = 0 
Members
ValueMemberDescription
0x00000000None Default
Remarks

The ConvertFromImageOptions are used as an options for the RasterImageConverter.ConvertFromImage method.

For more information refer to RasterImage and GDI/GDI+.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
 
 
public void ConvertFromImageExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "ConvertFromImage.bmp"); 
 
   // Create a GDI+ image 
   using (Bitmap btmp = new Bitmap(320, 200)) 
   { 
      using (Graphics g = Graphics.FromImage(btmp)) 
      { 
         g.Clear(Color.Yellow); 
         g.FillEllipse(Brushes.Red, new Rectangle(0, 0, btmp.Width, btmp.Height)); 
 
         // Convert this image to RasterImage 
 
         using (RasterImage image = RasterImageConverter.ConvertFromImage(btmp, ConvertFromImageOptions.None)) 
         { 
            // Save it 
            codecs.Save(image, destFileName, RasterImageFormat.Bmp, 0); 
         } 
      } 
   } 
 
   // Clean up 
   codecs.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

See Also

Reference

Leadtools.Drawing Namespace

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Drawing Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.