Skip to content

Iron 608 function for ironocr#21

Merged
mee-ironsoftware merged 16 commits intomasterfrom
IRON-608-function-for-ironocr
Nov 14, 2022
Merged

Iron 608 function for ironocr#21
mee-ironsoftware merged 16 commits intomasterfrom
IRON-608-function-for-ironocr

Conversation

@mee-ironsoftware
Copy link
Copy Markdown
Member

AnyBitmap

Bug Fixed

  • Now AnyBitmap can read Tiff that have different frame dimension. But will set all images to the largest dimension.
  • Add missing AnyBitmap.FromStream. At first, we have only MemoryStream.

Functional Added

Image manipulated

  • AnyBitmap.Clone(CropRectangle) to Clone image with CropRectangle
AnyBitmap bitmap = AnyBitmap.FromFile("file");
AnyBitmap cropBitmap = bitmap.Clone(new CropRectangle(10, 10, 50, 50);
  • AnyBitmap.BitsPerPixel to Gets colors depth, in number of bits per pixel.
AnyBitmap bitmap = AnyBitmap.FromFile("file");
int bpp = bitmap.BitsPerPixel;

Tiff image manipulated

  • AnyBitmap.FrameCount to Gets the number of frames in our loaded Image. Each “frame” is a page of an image such as Tiff or Gif. All other image formats return 1.
AnyBitmap bitmap = AnyBitmap.FromFile("tiff-image-file");
int frameCount = bitmap.FrameCount;
  • AnyBitmap.GetAllFrames to Gets all of the cloned frames in our loaded Image. Each "frame" is a page of an image such as Tiff or Gif. All other image formats return an IEnumerable of length 1.
AnyBitmap bitmap = AnyBitmap.FromFile("tiff-image-file");
IEnumerable<AnyBitmap> bitmaps = bitmap.GetAllFrames();

Create multiple page image

  • This will create image that has more than 1 page. If the dimension is different will set all images to the largest dimension.
  • AnyBitmap.CreateMultiFrameTiff(IEnumerable<AnyBitmap>) to Creates a multi-frame TIFF image from multiple AnyBitmaps.
// Create multiple page Tiff image by Array of AnyBitmap
List<AnyBitmap> bitmaps = new List<AnyBitmap>();
AnyBitmap anyBitmap = AnyBitmap.CreateMultiFrameTiff(bitmaps);

// Create multiple page Tiff image by Array of fully qualified file path
List<string> imagePaths = new List<string>();
AnyBitmap anyBitmap = AnyBitmap.CreateMultiFrameTiff(imagePaths);

int frameCount = anyBitmap.FrameCount;
List<AnyBitmap> frames = anyBitmap.GetAllFrames;
  • AnyBitmap.CreateMultiFrameGif(IEnumerable<AnyBitmap>) to Creates a multi-frame GIF image from multiple AnyBitmaps.
// Create multiple page Gif image by Array of AnyBitmap
List<AnyBitmap> bitmaps = new List<AnyBitmap>();
AnyBitmap anyBitmap = AnyBitmap.CreateMultiFrameGif(bitmaps);

// Create multiple page Gif image by Array of fully qualified file path
List<string> imagePaths = new List<string>();
AnyBitmap anyBitmap = AnyBitmap.CreateMultiFrameGif(imagePaths);
int frameCount = anyBitmap.FrameCount;
List<AnyBitmap> frames = anyBitmap.GetAllFrames;

Color

Bug Fixed

  • Add missing XML comment of the class
  • Modify XML comment

Functional Added

  • Color.ToArgb to Gets the 32-bit ARGB value of this Color structure.
IronSoftware.Drawing.Color ironColor = IronSoftware.Drawing.Color.Azure;
int argb = ironColor.ToArgb();

CropRectangle

Bug Fixed

  • Add missing XML comment of the class
  • Modify XML comment

Functional Added

  • CropRectangle.Units to specify Unit of measurement. (Pixels, Millimeters)
  • CropRectangle can convert between Pixels and Millimeters
int useDPI = 96;
CropRectangle pxRect = new CropRectangle(0, 0, 150, 150, MeasurementUnits.Pixels);
CropRectangle mmRect = pxRect.ConvertTo(MeasurementUnits.Millimeters, useDPI);

Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/Color.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/Color.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/Color.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/CropRectangle.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/CropRectangle.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/CropRectangle.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/CropRectangle.cs Outdated
Comment thread IronSoftware.Drawing/IronSoftware.Drawing.Common/CropRectangle.cs Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Copy link
Copy Markdown
Contributor

@mbkrispy mbkrispy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've suggested a few changes. But overall looks good. Thanks 👍

@mee-ironsoftware mee-ironsoftware merged commit f20c9b9 into master Nov 14, 2022
@artem-iron artem-iron deleted the IRON-608-function-for-ironocr branch March 28, 2023 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants