Returns the horizontal width and vertical height of a rotated barcode symbol in dots or pixels. The barcode symbol is specified by the properties of this barcode component.
function DrawToSize(var Width, Height, SymbolWidth, SymbolHeight: Single; Module: Single = 0; Angle: Single = -1; Canvas: TCanvas = nil; HDPI: Integer = 0; VDPI: Integer = 0): Integer; overload; virtual;
The method returns the horizontal width and vertical height of a rotated barcode symbol that is specified by properties of this barcode component, in dots or pixels.
Width: Single; Returns the horizontal width of the rotated barcode symbol in dots or pixels in the horizontal direction (using the horizontal resolution).
If the quiet zones are displayed (please read the ShowQuietZone property about whether or not the quiet zones will be displayed), they are included in the barcode symbol. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
For the TBarcodeFmx2D_Code16K barcode component, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone property is set to false. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
Height: Single; Returns the vertical height of the rotated barcode symbol in dots or pixels in the vertical direction (using the vertical resolution).
If the quiet zones are displayed (please read the ShowQuietZone property about whether or not the quiet zones will be displayed), they are included in the barcode symbol. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
For the TBarcodeFmx2D_Code16K barcode component, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone property is set to false. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
SymbolWidth: Single; Returns the distance between the leading and trailing of the rotated barcode symbol in dots or pixels (using the horizontal resolution).
If the quiet zones are displayed (please read the ShowQuietZone property about whether or not the quiet zones will be displayed), they are included in the barcode symbol. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
For the TBarcodeFmx2D_Code16K barcode component, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone property is set to false. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
See also the "BarcodeWidth" property.
SymbolHeight: Single; Returns the distance between the top and bottom of the rotated barcode symbol in dots or pixels (using the vertical resolution).
If the quiet zones are displayed (please read the ShowQuietZone property about whether or not the quiet zones will be displayed), they are included in the barcode symbol. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
See also the "BarcodeHeight" property.
Module: Single; Specifies the module size in dots or pixels (using the horizontal resolution). It defaults to 0 if the Module parameter is not provided, and the value of Module property will be used.
For the Matrix 2D barcode symbology (excluding the TBarcodeFmx2D_MaxiCode barcode symbology), the module is single cell (a suqare shape) used to encode one bit data. The parameter specifies the module width and height. See diagram:
For the TBarcodeFmx2D_MaxiCode barcode symbology, the module is single cell (a regular hexagonal shape) used to encode one bit data. The parameter specifies the horizonal width of a module. Also, it's the center to center horizontal distance between adjacent modules. See diagram:
For the Stacked 2D barcode symbology and Linear 1D barcode symbology, the module is the thinest bar (or space) in the barcode symbol. The parameter specifies the module width. See diagram:
See also the "Module" property.
Angle: Single; Specifies an angle in degrees to rotate the barcode symbol and its quiet zones (if they are displayed, please read the ShowQuietZone property about whether or not the quiet zones will be displayed) anticlockwise. See diagram (the quiet zones are drawn in claSilver color in order to accentuate them):
The parameter defaults to -1 if the Angle parameter is not provided, and the barcode symbol will be rotated based on the value of the Orientation property:
If you want to use the -1 degrees, the 359 degrees can be used instead.
Canvas: TCanvas; Specifies target canvas to drawn the barcode symbol on it. The parameter is useful for obtaining the physical resolution if one of HDPI and VDPI parameters is set to 0. If both HDPI and VDPI parameters are set to 0, or both HDPI and VDPI parameters are not set to 0, the parameter will be ignored, in this case, you can set it to nil.
HDPI: Integer, Specifies the horizontal resolution of canvas in DPI. It's the number of dots or pixels per inch. It defaults to 0 if the HDPI is not provided, and the physical horizontal resolution obtained from the Canvas parameter will be used. If both HDPI and VDPI are set to 0, it indicates the horizontal resolution is equal to the vertical resolution.
VDPI: Integer, Specifies the vertical resolution of canvas in DPI. It's the number of dots or pixels per inch. It defaults to 0 if the VDPI is not provided, and the physical vertical resolution obtained from the Canvas parameter will be used. If both VDPI and HDPI are set to 0, it indicates the vertical resolution is equal to the horizontal resolution.
This method can return one of these values (these consts are defined in the pfmxCore2D unit):
Verify_InvalidIndex_AfterBarcode (-4):
If you use the Barcode property to specify the barcode text, and use the OnEncode event handle to encode the barcode text to a bytes sequence in your own encoding scheme, the Verify_InvalidIndex_AfterBarcode (-4) indicats that an invalid byte value is in the suffix codes of the bytes sequence.
Verify_InvalidIndex_BeforeBarcode (-3):
If you use the Barcode property to specify the barcode text, and use the OnEncode event handle to encode the barcode text to a bytes sequence in your own encoding scheme, the Verify_InvalidIndex_BeforeBarcode (-3) indicats that an invalid byte value is in the prefix codes of the bytes sequence (for example the BOM).
Verify_InvalidLength (-2):
If you use the Barcode property to specify the barcode text, it indicates that the length of Barcode property value is invalid, also the OnInvalidLength event will occur.
If you use the Data property to specify the barcode text, it indicates that the length of Data property value is invalid, also the OnInvalidDataLength event will occur.
Verify_OK (-1):
It indicates the method succeeds.
Verify_InvalidIndex_Base (0), and greater than 0:
If you use the Barcode property to specify the barcode text, it indicates that an invalid character is in the barcode text, also the OnInvalidChar event will occur. The return value is the position index of the invalid charactere. For 32-bit Windows, 64-bit Windows, and Mac OSX platform, the index 1 denotes that the first character is invalid character. For iOS and Android platform, the index 0 denotes that the first character is invalid character.
If you use the Data property to specify the barcode data, it indicates that an invalid byte value is in the barcode data, also the OnInvalidDataChar event will occur. The return value is the position index of the invalid byte value. The index 0 denotes that the first byte value is invalid byte value.