Dev Center
Swift
Objective-C
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

Class iImageData

Stores the image data.

  • Objective-C
  • Swift
  1. @interface iImageData : NSObject
    
  2. class iImageData : NSObject
    
Method Description
toUIImage Convert the ImageData to a UIImage.

toUIImage

Convert the iImageData to an UIImage.

  • Objective-C
  • Swift
  1. - (UIImage * _Nullable)toUIImage:(NSError *_Nullable *_Nullable)error;
    
  2. func toUIImage() throws -> UIImage
    

Return Value

An UIImage that converted from the iImageData.

Code Snippet

  • Objective-C
  • Swift
  1. NSError *error;
    UIImage *image = [imageData toUIImage:&error];
    
  2. do{
       image = try imageData.toUIImage()
    } catch{
       // Add your code to deal with exceptions.
    }
    
Attribute Descriptions
bytes The image data content in a byte array.
width The width of the image in pixels.
height The height of the image in pixels.
stride The stride (or scan width) of the image.
format The image pixel format used in the image byte array.

bytes

The image data content in a byte array.

  • Objective-C
  • Swift
  1. @property (nonatomic, nonnull) NSData* bytes;
    
  2. var bytes: Data? { get set }
    

width

The width of the image in pixels.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) NSInteger width
    
  2. var width: Int { get set }
    

height

The height of the image in pixels.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) NSInteger height
    
  2. var height: Int { get set }
    

stride

The stride (or scan width) of the image.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) NSInteger stride
    
  2. var stride: Int { get set }
    

format

The image pixel format used in the image byte array.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) EnumImagePixelFormat format
    
  2. var format: EnumImagePixelFormat { get set }
    

orientation

The orientation of the image. It can be 0, 90, 180, or 270 based on the device orientation.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) NSInteger orientation
    
  2. var orientation: Int { get set }
    

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.11
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.13
    • Version 9.2.11
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
  • Version 8.x
    • Version 8.9.3
    • Version 8.9.1
    • Version 8.9.0
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.1
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +