Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR-Code-Generator:


Compiler 10 Seattle 10 1 Berlin 10 2 Tokyo 10 3 Rio
10 4 Sydney 11 Alexandria 12 Athens
Components Quricol dpk QuricolAPI pas QuricolCode pas
Description QR Code Generator
Last Update
License Freeware


A QR code, short for quick-response code, is a type of two-dimensional matrix barcode invented in 1994 by Masahiro Hara of the Japanese company Denso Wave for labelling automobile parts. It features black squares on a white background with fiducial markers, readable by imaging devices like cameras, and processed using Reed–Solomon error correction until the image can be appropriately interpreted. The required data is then extracted from patterns that are present in both the horizontal and the vertical components of the QR image.


QR-Code-Generator


Export Formats : Bitmap; Jpg; Png; GIF; WMF; EMF;


Graphic:

Name Description
GenerateBitmapFile Generates Windows Bitmap file with the text encoded as QR code
GeneratePngFile Generates PNG file with the text encoded as QR code
GetBitmapImage Created Windows Bitmap image with the text encoded as QR code
GetPngStream Writes PNG image to the stream. Can be useful for web development

Whereas a barcode is a machine-readable optical image that contains information specific to the labeled item, the QR code contains the data for a locator, an identifier, and web tracking. To store data efficiently, QR codes use four standardized modes of encoding: numeric, alphanumeric, byte or binary, and kanji. Compared to standard UPC barcodes, the QR labeling system was applied beyond the automobile industry because of faster reading of the optical image and greater data-storage capacity in applications such as product tracking, item identification, time tracking, document management, and general marketing.


Variables:

Parameters Description
const FileName: string The name of the bitmap file
const Text: string The text to encode
Margin: integer = 4 The margin from the border
PixelSize: integer = 3 The size of the one image point.
Level: TErrorCorretion = QualityLow The error correction level

Code Example:

var
  bmp : TBitmap;
  MS : TMemoryStream;
begin
  try
    //Generate Windows bitmap and save to file
    TQRCode.GenerateBitmapFile('delphi1.bmp', 'http://delphi32.blogspot.com', QualityLow);

    //Generate PNG image and save to file
    TQRCode.GeneratePngFile('delphi1.png', 'http://delphi32.blogspot.com');

    //Generate TBitmap
    bmp := TQRCode.GetBitmapImage('http://www.krento.net');
    bmp.SaveToFile('delphi2.bmp');

    //Generate PNG to the memory stream
    MS := TMemoryStream.Create;
    TQRCode.GetPngStream(MS, 'http://www.krento.net');
    MS.Position := 0;
    MS.SaveToFile('delphi2.png');
    MS.Free;

  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;

Scale function

procedure Scale(const src, dest: TGraphic;
  DestWidth, DestHeight: integer; Smooth: Boolean = true);
var
  temp, aCopy: TBitmap;
  faktor: double;
begin
  Assert(Assigned(src) and Assigned(dest));
  if (src.Width = 0) or (src.Height = 0) then
    raise Exception.CreateFmt('Invalid source dimensions: %d x %d',[src.Width, src.Height]);
  if src.Width > DestWidth then
    begin
      faktor := DestWidth / src.Width;
      if (src.Height * faktor) > DestHeight then
        faktor := DestHeight / src.Height;
    end
  else
    begin
      faktor := DestHeight / src.Height;
      if (src.Width * faktor) > DestWidth then
        faktor := DestWidth / src.Width;
    end;
  try
    aCopy := TBitmap.Create;
    try
      aCopy.PixelFormat := pf24Bit;
      aCopy.Assign(src);
      temp := TBitmap.Create;
      try
        temp.Width := round(src.Width * faktor);
        temp.Height := round(src.Height * faktor);
        if Smooth then
          SetStretchBltMode(temp.Canvas.Handle, HALFTONE);
        StretchBlt(temp.Canvas.Handle, 0, 0, temp.Width, temp.Height,
          aCopy.Canvas.Handle, 0, 0, aCopy.Width, aCopy.Height, SRCCOPY);
        dest.Assign(temp);
      finally
        temp.Free;
      end;
    finally
      aCopy.Free;
    end;
  except
    on E: Exception do
      MessageBox(0, PChar(E.Message), nil, MB_OK or MB_ICONERROR);
  end;
end;

Colorize Pixel

// colorize qr-code
  if Form2.CheckBox4.Checked = true then
  begin
    BMP := TBitmap.Create;
    // copy original pixel to bimtap
    BMP := TQRCode.GetBitmapImage(Memo1.Text,SpinEdit1.Value, SpinEdit2.Value);
    // Identify all black pixels and recolor them in RGB.
    // for both height and width
    for x := 0 to BMP.Height do
    begin
      for y := 0 to BMP.Width do
      begin
        if BMP.Canvas.Pixels[y,x] = clBlack then
            BMP.Canvas.Pixels[y,x]:= Form2.Shape1.Brush.Color;
      end;
    end;
  end;


No component for older Versions:

Delphi Multi
The second project contains no installable component and can be compiled with older versions.

quricol32.dll is a Dynamic Link Library (DLL) developed by Serhiy Perevoznyk for Quricol QR Barcode Library and is described as QR barcode library.

DLL files (Dynamic Link Library) are used by Windows programs to share code and resources. It allows multiple applications to use the same functions, improving performance and reducing redundancy. Most errors involving qjpeg.dll occur because the DLL is missing, corrupted, or outdated. In many cases, reinstalling the related application, repairing windows or replacing the DLL resolves the issue.

Blog : https://delphi32.blogspot.com
QR barcode Driver Download : https://www.dllme.com/dll/files/quricol32


How to Install this DLL:

To install quricol32.dll, first copy the DLL into the application folder where the .exe is located. Use the Windows system folders if the error continues or you can’t find the application folder. If you are not sure which version (32-bit or 64-bit) to use, you can safely install both.

  • 64-bit Application Folder: → copy to:
    C:\Program Files\AppName\quricol32.dll

  • 32-bit Application Folder: → copy to:
    C:\Program Files (x86)\AppName\quricol32.dll

  • 64-bit Windows System Folder: → copy to:
    C:\Windows\System32\quricol32.dll

  • 32-bit Windows System Folder: → copy to:
    C:\Windows\SysWOW64\quricol32.dll


How to Register this DLL

Most DLL files do not need registration, but some DLLs are COM components and must be registered to work correctly.

  • 64-bit Register DLL: You can drag the DLL into PowerShell to auto-fill the full path.
    regsvr32 "C:\path\to\quricol32.dll"

  • 32-bit Register DLL:
    C:\Windows\SysWOW64\regsvr32 "C:\path\to\quricol32.dll"

About

Generating Qr Codes with Delphi

Resources

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages