Dev Center
Swift
Objective-C
Table of contents

DSDecodedBarcodeElement Class

DSDecodedBarcodeElement extends the DSRegionObjectElement class and represents a decoded barcode element.

Definition

Assembly: DynamsoftBarcodeReader.xcframework

  • Objective-C
  • Swift
  1. @interface DSDecodedBarcodeElement: DSRegionObjectElement
    
  2. class DecodedBarcodeElement: RegionObjectElement
    

Methods

Methods Description
init Initialize a new DSDecodedBarcodeElement object.
getText Returns the text of the decoded barcode.
setText Set the text of the decoded barcode.
getBytes Returns the raw bytes of the decoded barcode.
setBytes Set the raw bytes of the decoded barcode.
getFormat Returns the format of the decoded barcode.
setFormat Set the format of the decoded barcode.
getConfidence Returns the confidence score of the decoded barcode.
setConfidence Set the confidence of the decoded barcode.
getFormatString Returns the format string of the decoded barcode.
getAngle Returns the orientation angle of the decoded barcode.
getModuleSize Returns the module size of the decoded barcode.
getDetails Returns the DSBarcodeDetails of the decoded barcode.
getExtendedBarcodeResults Returns the extended barcode results of the decoded barcode.
isDPM Specifies if the decoded barcode is a DPM code or not.
isMirrored Specifies if the decoded barcode is mirrored or not.

The following attributes are inherited from class DSRegionObjectElement.

Method Description
getLocation Returns the location info of the element.
setLocation Sets the location info of the element.
getReferencedElement Returns the referenced element that supports the capturing of this element.
getRegionObjectElementType Returns the type of the element.

init

Create a new DSDecodedBarcodeElement object.

  • Objective-C
  • Swift
  1. - (instancetype)init;
    
  2. init()
    

getText

Returns the text of the decoded barcode.

  • Objective-C
  • Swift
  1. - (NSString *)getText
    
  2. func getText() -> String
    

Return Value

A string representing the text of the decoded barcode.

setText

Set the text of the decoded barcode. The barcode bytes are changed as well to reflect the new text.

  • Objective-C
  • Swift
  1. - (NSInteger)setText:(NSString *)text
    
  2. func setText(text: String) -> NSInteger
    

Parameters

[in] text: The text to be set for the decoded barcode.

Return Value

Returns the ErrorCode if it fails. Otherwise, returns 0.

getBytes

Returns the raw bytes of the decoded barcode.

  • Objective-C
  • Swift
  1. - (NSData *)getBytes
    
  2. func getBytes() -> NSData
    

Return Value

A NSData object representing the raw bytes of the decoded barcode.

setBytes

Set the raw bytes of the decoded barcode. The text of the barcode will change to reflect the new barcode bytes.

  • Objective-C
  • Swift
  1. - (NSInteger)setBytes:(NSData *)bytes
    
  2. func setBytes(bytes: NSData) -> NSInteger
    

Parameters

[in] bytes: The bytes of the decoded barcode.

Return Value

Returns the ErrorCode if it fails. Otherwise, returns 0.

getFormat

Returns the format of the decoded barcode as a DSBarcodeFormat item.

  • Objective-C
  • Swift
  1. - (DSBarcodeFormat)getFormat
    
  2. func getFormat() -> BarcodeFormat
    

Return Value

A DSBarcodeFormat item representing the format of the decoded barcode.

setFormat

Set the format of the decoded barcode using a DSBarcodeFormat item.

  • Objective-C
  • Swift
  1. - (NSInteger)setFormat:(DSBarcodeFormat)format
    
  2. func setFormat(_ format: BarcodeFormat) -> NSInteger
    

Parameters

[in] format: The format of the decoded barcode.

Return Value

Returns the ErrorCode if it fails. Otherwise, returns 0.

getConfidence

Returns the confidence score of the decoded barcode.

  • Objective-C
  • Swift
  1. - (NSInteger)getConfidence
    
  2. func getConfidence() -> NSInteger
    

Return Value

An integer representing the confidence score.

setConfidence

Set the confidence score of the decoded barcode.

  • Objective-C
  • Swift
  1. - (NSInteger)setConfidence:(NSInteger)confidence
    
  2. func setConfidence(_ confidence: NSInteger) -> NSInteger
    

Parameters

[in] confidence: The confidence of the decoded barcode.

Return Value

Returns the ErrorCode if it fails. Otherwise, returns 0.

getFormatString

Returns the format of the decode barcode as a string.

  • Objective-C
  • Swift
  1. - (NSString *)getFormatString
    
  2. func getFormatString() -> String
    

Return Value

A string representing the format of the barcode.

getAngle

Returns the orientation angle of the decoded barcode should it be rotated in any way.

  • Objective-C
  • Swift
  1. - (NSInteger)getAngle
    
  2. func getAngle() -> NSInteger
    

Return Value

An integer representing the orientation angle of the barcode.

getModuleSize

Returns the module size of the decoded barcode.

  • Objective-C
  • Swift
  1. - (NSInteger)getModuleSize
    
  2. func getModuleSize() -> NSInteger
    

Return Value

An integer representing the module size of the decoded barcode.

getDetails

Returns the BarcodeDetails of the decoded barcode.

  • Objective-C
  • Swift
  1. - (DSBarcodeDetails *)getDetails
    
  2. func getDetails() -> BarcodeDetails
    

Return Value

A DSBarcodeDetails object representing the details of the decoded barcode.

getExtendedBarcodeResults

Returns the extended barcode result(s) of the decoded barcode as a DSExtendedBarcodeResult object. Please visit the DSExtendedBarcodeResult page to learn more of what information is contained there.

  • Objective-C
  • Swift
  1. - (nullable NSArray<DSExtendedBarcodeResult *>*)getExtendedBarcodeResults
    
  2. func getExtendedBarcodeResults() -> [ExtendedBarcodeResult]?
    

Return Value

An array of DSExtendedBarcodeResult that represents the extended barcode results.

isDPM

Specifies if the decoded barcode is a Direct Part Marking (DPM) code or not. DPM codes are read by setting the DPMCodeReadingModes.

  • Objective-C
  • Swift
  1. - (BOOL)isDPM
    
  2. func isDPM() -> Bool
    

Return Value

A BOOL value describing whether the barcode is a DPM code or not.

isMirrored

Specifies if the decoded barcode is mirrored or not. Mirrored barcodes are read by setting the MirrorMode.

  • Objective-C
  • Swift
  1. - (BOOL)isMirrored
    
  2. func isMirrored() -> Bool
    

Return Value

A BOOL value describing whether the barcode is mirrored or not.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
  • 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.11
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.13
    • 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 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
    • Version 7.6.0
    • Version 7.5.0
Change +