←Select platform

QRBarcodeSymbolModel Enumeration

Summary
Specifies the QR symbol size.
Syntax
C#
Objective-C
C++/CLI
Java
Python
[SerializableAttribute()] 
public enum QRBarcodeSymbolModel   
typedef NS_ENUM(NSInteger, LTQRBarcodeSymbolModel) { 
 LTQRBarcodeSymbolModelModel2AutoSize,  
 LTQRBarcodeSymbolModelModel2Version1,  
 LTQRBarcodeSymbolModelModel2Version2,  
 LTQRBarcodeSymbolModelModel2Version3,  
 LTQRBarcodeSymbolModelModel2Version4,  
 LTQRBarcodeSymbolModelModel2Version5,  
 LTQRBarcodeSymbolModelModel2Version6,  
 LTQRBarcodeSymbolModelModel2Version7,  
 LTQRBarcodeSymbolModelModel2Version8,  
 LTQRBarcodeSymbolModelModel2Version9,  
 LTQRBarcodeSymbolModelModel2Version10,  
 LTQRBarcodeSymbolModelModel2Version11,  
 LTQRBarcodeSymbolModelModel2Version12,  
 LTQRBarcodeSymbolModelModel2Version13,  
 LTQRBarcodeSymbolModelModel2Version14,  
 LTQRBarcodeSymbolModelModel2Version15,  
 LTQRBarcodeSymbolModelModel2Version16,  
 LTQRBarcodeSymbolModelModel2Version17,  
 LTQRBarcodeSymbolModelModel2Version18,  
 LTQRBarcodeSymbolModelModel2Version19,  
 LTQRBarcodeSymbolModelModel2Version20,  
 LTQRBarcodeSymbolModelModel2Version21,  
 LTQRBarcodeSymbolModelModel2Version22,  
 LTQRBarcodeSymbolModelModel2Version23,  
 LTQRBarcodeSymbolModelModel2Version24,  
 LTQRBarcodeSymbolModelModel2Version25,  
 LTQRBarcodeSymbolModelModel2Version26,  
 LTQRBarcodeSymbolModelModel2Version27,  
 LTQRBarcodeSymbolModelModel2Version28,  
 LTQRBarcodeSymbolModelModel2Version29,  
 LTQRBarcodeSymbolModelModel2Version30,  
 LTQRBarcodeSymbolModelModel2Version31,  
 LTQRBarcodeSymbolModelModel2Version32,  
 LTQRBarcodeSymbolModelModel2Version33,  
 LTQRBarcodeSymbolModelModel2Version34,  
 LTQRBarcodeSymbolModelModel2Version35,  
 LTQRBarcodeSymbolModelModel2Version36,  
 LTQRBarcodeSymbolModelModel2Version37,  
 LTQRBarcodeSymbolModelModel2Version38,  
 LTQRBarcodeSymbolModelModel2Version39,  
 LTQRBarcodeSymbolModelModel2Version40,  
 LTQRBarcodeSymbolModelModel1AutoSize,  
 LTQRBarcodeSymbolModelModel1Version1,  
 LTQRBarcodeSymbolModelModel1Version2,  
 LTQRBarcodeSymbolModelModel1Version3,  
 LTQRBarcodeSymbolModelModel1Version4,  
 LTQRBarcodeSymbolModelModel1Version5,  
 LTQRBarcodeSymbolModelModel1Version6,  
 LTQRBarcodeSymbolModelModel1Version7,  
 LTQRBarcodeSymbolModelModel1Version8,  
 LTQRBarcodeSymbolModelModel1Version9,  
 LTQRBarcodeSymbolModelModel1Version10,  
 LTQRBarcodeSymbolModelModel1Version11,  
 LTQRBarcodeSymbolModelModel1Version12,  
 LTQRBarcodeSymbolModelModel1Version13,  
 LTQRBarcodeSymbolModelModel1Version14 
}; 
public enum QRBarcodeSymbolModel 
[SerializableAttribute()] 
public enum class QRBarcodeSymbolModel   
class QRBarcodeSymbolModel(Enum): 
   Model2AutoSize = 0 
   Model2Version1 = 1 
   Model2Version2 = 2 
   Model2Version3 = 3 
   Model2Version4 = 4 
   Model2Version5 = 5 
   Model2Version6 = 6 
   Model2Version7 = 7 
   Model2Version8 = 8 
   Model2Version9 = 9 
   Model2Version10 = 10 
   Model2Version11 = 11 
   Model2Version12 = 12 
   Model2Version13 = 13 
   Model2Version14 = 14 
   Model2Version15 = 15 
   Model2Version16 = 16 
   Model2Version17 = 17 
   Model2Version18 = 18 
   Model2Version19 = 19 
   Model2Version20 = 20 
   Model2Version21 = 21 
   Model2Version22 = 22 
   Model2Version23 = 23 
   Model2Version24 = 24 
   Model2Version25 = 25 
   Model2Version26 = 26 
   Model2Version27 = 27 
   Model2Version28 = 28 
   Model2Version29 = 29 
   Model2Version30 = 30 
   Model2Version31 = 31 
   Model2Version32 = 32 
   Model2Version33 = 33 
   Model2Version34 = 34 
   Model2Version35 = 35 
   Model2Version36 = 36 
   Model2Version37 = 37 
   Model2Version38 = 38 
   Model2Version39 = 39 
   Model2Version40 = 40 
   Model1AutoSize = 41 
   Model1Version1 = 42 
   Model1Version2 = 43 
   Model1Version3 = 44 
   Model1Version4 = 45 
   Model1Version5 = 46 
   Model1Version6 = 47 
   Model1Version7 = 48 
   Model1Version8 = 49 
   Model1Version9 = 50 
   Model1Version10 = 51 
   Model1Version11 = 52 
   Model1Version12 = 53 
   Model1Version13 = 54 
   Model1Version14 = 55 
Members
ValueMemberDescription
0Model2AutoSize

QR Model 2 Auto size

1Model2Version1

QR Model 2 Version 1

2Model2Version2

QR Model 2 Version 2

3Model2Version3

QR Model 2 Version 3

4Model2Version4

QR Model 2 Version 4

5Model2Version5

QR Model 2 Version 5

6Model2Version6

QR Model 2 Version 6

7Model2Version7

QR Model 2 Version 7

8Model2Version8

QR Model 2 Version 8

9Model2Version9

QR Model 2 Version 9

10Model2Version10

QR Model 2 Version 10

11Model2Version11

QR Model 2 Version 11

12Model2Version12

QR Model 2 Version 12

13Model2Version13

QR Model 2 Version 13

14Model2Version14

QR Model 2 Version 14

15Model2Version15

QR Model 2 Version 15

16Model2Version16

QR Model 2 Version 16

17Model2Version17

QR Model 2 Version 17

18Model2Version18

QR Model 2 Version 18

19Model2Version19

QR Model 2 Version 19

20Model2Version20

QR Model 2 Version 20

21Model2Version21

QR Model 2 Version 21

22Model2Version22

QR Model 2 Version 22

23Model2Version23

QR Model 2 Version 23

24Model2Version24

QR Model 2 Version 24

25Model2Version25

QR Model 2 Version 25

26Model2Version26

QR Model 2 Version 26

27Model2Version27

QR Model 2 Version 27

28Model2Version28

QR Model 2 Version 28

29Model2Version29

QR Model 2 Version 29

30Model2Version30

QR Model 2 Version 30

31Model2Version31

QR Model 2 Version 31

32Model2Version32

QR Model 2 Version 32

33Model2Version33

QR Model 2 Version 33

34Model2Version34

QR Model 2 Version 34

35Model2Version35

QR Model 2 Version 35

36Model2Version36

QR Model 2 Version 36

37Model2Version37

QR Model 2 Version 37

38Model2Version38

QR Model 2 Version 38

39Model2Version39

QR Model 2 Version 39

40Model2Version40

QR Model 2 Version 40

41Model1AutoSize

QR Model 1 Auto size

42Model1Version1

QR Model 1 Version 1

43Model1Version2

QR Model 1 Version 2

44Model1Version3

QR Model 1 Version 3

45Model1Version4

QR Model 1 Version 4

46Model1Version5

QR Model 1 Version 5

47Model1Version6

QR Model 1 Version 6

48Model1Version7

QR Model 1 Version 7

49Model1Version8

QR Model 1 Version 8

50Model1Version9

QR Model 1 Version 9

51Model1Version10

QR Model 1 Version 10

52Model1Version11

QR Model 1 Version 11

53Model1Version12

QR Model 1 Version 12

54Model1Version13

QR Model 1 Version 13

55Model1Version14

QR Model 1 Version 14

Remarks

Used as the type for the QRBarcodeData.SymbolModel property to specify the QR barcode's symbol size.

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Barcode; 
using Leadtools.ImageProcessing; 
 
 
public void QRBarcode_Example() 
{ 
   string imageFileName = Path.Combine(LEAD_VARS.ImagesDir, "MyQRBarcodes.tif"); 
 
   BarcodeEngine engine = new BarcodeEngine(); 
 
   // Create the image to write the barcodes to 
   int resolution = 300; 
   using (RasterImage image = RasterImage.Create((int)(8.5 * resolution), (int)(11.0 * resolution), 1, resolution, RasterColor.FromKnownColor(RasterKnownColor.White))) 
   { 
      // Write two QR barcodes 
      WriteBarcode(engine.Writer, image, QRBarcodeSymbolModel.Model1AutoSize, "QR Data 1", false); 
      WriteBarcode(engine.Writer, image, QRBarcodeSymbolModel.Model2Version30, "QR Data 2", true); 
 
      // Save the image 
      using (RasterCodecs codecs = new RasterCodecs()) 
      { 
         codecs.Save(image, imageFileName, RasterImageFormat.CcittGroup4, 1); 
      } 
   } 
 
   // Now read the barcodes again 
   using (RasterCodecs codecs = new RasterCodecs()) 
   { 
      using (RasterImage image = codecs.Load(imageFileName)) 
      { 
         // Read all the QR barcodes 
         ReadBarcodes(engine.Reader, image); 
      } 
   } 
} 
 
private void WriteBarcode(BarcodeWriter writer, RasterImage image, QRBarcodeSymbolModel symbolModel, string value, bool topLeft) 
{ 
   // Create the barcode data 
   QRBarcodeData barcode = BarcodeData.CreateDefaultBarcodeData(BarcodeSymbology.QR) as QRBarcodeData; 
   barcode.SymbolModel = symbolModel; 
   barcode.Value = value; 
   barcode.Symbology = BarcodeSymbology.QR; 
 
   // We will use the alignment to position the barcodes, so use all of the image 
   barcode.Bounds = new LeadRect(0, 0, image.ImageWidth, image.ImageHeight); 
 
   // Set the write options 
   QRBarcodeWriteOptions options = new QRBarcodeWriteOptions(); 
 
   if (topLeft) 
   { 
      options.HorizontalAlignment = BarcodeAlignment.Near; 
      options.VerticalAlignment = BarcodeAlignment.Near; 
   } 
   else 
   { 
      options.HorizontalAlignment = BarcodeAlignment.Far; 
      options.VerticalAlignment = BarcodeAlignment.Far; 
   } 
 
   options.GroupNumber = 0; 
   options.GroupTotal = 0; 
   options.XModule = 30; 
   options.ECCLevel = QRBarcodeECCLevel.LevelL; 
 
   // Write it 
   Console.WriteLine("Writing barcode with symbol model: {0} and Data: {1}", symbolModel, value); 
   writer.WriteBarcode(image, barcode, options); 
} 
 
private void ReadBarcodes(BarcodeReader reader, RasterImage image) 
{ 
   // Setup read options 
   QRBarcodeReadOptions options = new QRBarcodeReadOptions(); 
   options.EnableDoublePass = false; 
   options.EnableDoublePassIfSuccess = true; 
   options.EnablePreprocessing = true; 
 
   Console.WriteLine("Reading QR barcodes"); 
   BarcodeData[] barcodes = reader.ReadBarcodes(image, LeadRect.Empty, 0, new BarcodeSymbology[] { BarcodeSymbology.QR }, new BarcodeReadOptions[] { options }); 
   Console.WriteLine("{0} barcodes found:", barcodes.Length); 
   foreach (QRBarcodeData barcode in barcodes) 
   { 
      string value = BarcodeData.ParseECIData(barcode.GetData()); 
      if (string.IsNullOrEmpty(value)) 
         value = barcode.Value; 
 
      Console.WriteLine(" At {0}, symbol model: {1} data: {2} and symbology: {3}", barcode.Bounds, barcode.SymbolModel, value, barcode.Symbology); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.File; 
import java.io.IOException; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.barcode.*; 
import leadtools.codecs.*; 
 
 
public void qrBarcodeExample() { 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
   String imageFileName = combine(LEAD_VARS_IMAGES_DIR, "QRBarcodes.tif"); 
   RasterCodecs codecs = new RasterCodecs(); 
   BarcodeEngine engine = new BarcodeEngine(); 
 
   // Create the image to write the barcodes to 
   int resolution = 300; 
   RasterImage image = RasterImage.create((int) (8.5 * resolution), (int) (11.0 * resolution), 1, resolution, 
         RasterColor.fromKnownColor(RasterKnownColor.WHITE)); 
 
   // Write two QR barcodes 
   writeBarcode(engine.getWriter(), image, QRBarcodeSymbolModel.MODEL1_AUTOSIZE, "QR Data 1", false); 
   writeBarcode(engine.getWriter(), image, QRBarcodeSymbolModel.MODEL2_VERSION30, "QR Data 2", true); 
 
   // Save the image 
   codecs.save(image, imageFileName, RasterImageFormat.CCITT_GROUP4, 1); 
 
   // Now read the barcodes again 
   image = codecs.load(imageFileName); 
 
   // Read all the QR barcodes 
   readBarcodes(engine.getReader(), image); 
 
   // Clean up 
   image.dispose(); 
   codecs.dispose(); 
 
   assertTrue("file unsuccessfully saved to " + imageFileName, (new File(imageFileName)).exists()); 
   System.out.printf("File saved successfully to %s%n", imageFileName); 
} 
 
// Create the barcode data 
private void writeBarcode(BarcodeWriter writer, RasterImage image, QRBarcodeSymbolModel symbolModel, String value, boolean topLeft) { 
   QRBarcodeData barcode = (QRBarcodeData) BarcodeData.createDefaultBarcodeData(BarcodeSymbology.QR); 
   barcode.setSymbolModel(symbolModel); 
   barcode.setValue(value); 
   barcode.setSymbology(BarcodeSymbology.QR); 
 
   // We will use the alignment to position the barcodes, so use all of the image 
   barcode.setBounds(new LeadRect(0, 0, image.getImageWidth(), image.getImageHeight())); 
 
   // Set the write options 
   QRBarcodeWriteOptions options = new QRBarcodeWriteOptions(); 
 
   if (topLeft) { 
      options.setHorizontalAlignment(BarcodeAlignment.NEAR); 
      options.setVerticalAlignment(BarcodeAlignment.NEAR); 
   } else { 
      options.setHorizontalAlignment(BarcodeAlignment.FAR); 
      options.setVerticalAlignment(BarcodeAlignment.FAR); 
   } 
 
   options.setGroupNumber(0); 
   options.setGroupTotal(0); 
   options.setXModule(30); 
   options.setECCLevel(QRBarcodeECCLevel.LEVEL_L); 
 
   // Write it 
   System.out.printf("Writing barcode with symbol model: %1s and Data: %2s %n", symbolModel, value); 
   writer.writeBarcode(image, barcode, options); 
} 
 
// Setup read options 
private void readBarcodes(BarcodeReader reader, RasterImage image) { 
   QRBarcodeReadOptions options = new QRBarcodeReadOptions(); 
   options.setEnableDoublePass(false); 
   options.setEnableDoublePassIfSuccess(true); 
   options.setEnablePreprocessing(true); 
 
   System.out.println("Reading QR barcodes"); 
   BarcodeData[] barcodes = reader.readBarcodes(image, LeadRect.getEmpty(), 0, 
         new BarcodeSymbology[] { BarcodeSymbology.QR }, new BarcodeReadOptions[] { options }); 
   System.out.printf("%s barcodes found: %n", barcodes.length); 
 
   for (BarcodeData barcode : barcodes) { 
      String value = BarcodeData.parseECIData(barcode.getData()); 
      if (value == null) 
         value = barcode.getValue(); 
 
      System.out.printf(" At %1s, symbol model: %2s data: %3s and symbology: %4s %n", barcode.getBounds(), 
            barcode.getData(), value, barcode.getSymbology()); 
   } 
} 
Requirements

Target Platforms

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

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