Преглед изворни кода

removed jpeg and png export support

Ugochukwu Mmaduekwe пре 5 година
родитељ
комит
4267e03e83

+ 0 - 57
QRCodeGenLib/src/Interfaces/QlpIQrCode.pas

@@ -75,63 +75,6 @@ type
     /// </remarks>
     function ToBitmapImage(AScale, ABorder: Int32): TQRCodeGenLibBitmap;
 
-{$IF DEFINED(VCL_OR_LCL)}
-    /// <summary>
-    /// Returns a jpeg image depicting this QR Code, with the specified
-    /// module scale and border modules. For example, ToJpegImage(scale=10,
-    /// border=4) means to pad the QR Code with 4 white border modules on all
-    /// four sides, and use 10×10 pixels to represent each module. The
-    /// resulting image contains the colors specified by the backgroundcolor
-    /// (by default = FFFFFF) and foregroundcolor (by default = 000000)
-    /// properties.
-    /// </summary>
-    /// <param name="AScale">
-    /// the side length (measured in pixels, must be positive) of each module
-    /// </param>
-    /// <param name="ABorder">
-    /// the number of border modules to add, which must be non-negative
-    /// </param>
-    /// <returns>
-    /// a new jpeg image representing this QR Code, with padding and scaling
-    /// </returns>
-    /// <exception cref="QlpQRCodeGenLibTypes|EArgumentOutOfRangeQRCodeGenLibException">
-    /// if the scale or border is out of range, or if <br />{AScale, ABorder,
-    /// FSize} cause the image dimensions to exceed System.High(Int32)
-    /// </exception>
-    /// <remarks>
-    /// <b>The caller is responsible for the lifetime of the returned image
-    /// object.</b>
-    /// </remarks>
-    function ToJpegImage(AScale, ABorder: Int32): TQRCodeGenLibJPEGImage;
-
-    /// <summary>
-    /// Returns a png image depicting this QR Code, with the specified
-    /// module scale and border modules. For example, ToPngImage(scale=10,
-    /// border=4) means to pad the QR Code with 4 white border modules on all
-    /// four sides, and use 10×10 pixels to represent each module. The
-    /// resulting image contains the colors specified by the backgroundcolor
-    /// (by default = FFFFFF) and foregroundcolor (by default = 000000)
-    /// properties.
-    /// </summary>
-    /// <param name="AScale">
-    /// the side length (measured in pixels, must be positive) of each module
-    /// </param>
-    /// <param name="ABorder">
-    /// the number of border modules to add, which must be non-negative
-    /// </param>
-    /// <returns>
-    /// a new png image representing this QR Code, with padding and scaling
-    /// </returns>
-    /// <exception cref="QlpQRCodeGenLibTypes|EArgumentOutOfRangeQRCodeGenLibException">
-    /// if the scale or border is out of range, or if <br />{AScale, ABorder,
-    /// FSize} cause the image dimensions to exceed System.High(Int32)
-    /// </exception>
-    /// <remarks>
-    /// <b>The caller is responsible for the lifetime of the returned image
-    /// object.</b>
-    /// </remarks>
-    function ToPngImage(AScale, ABorder: Int32): TQRCodeGenLibPNGImage;
-{$IFEND VCL_OR_LCL}
     /// <summary>
     /// Returns a string of SVG code for an image depicting this QR Code,
     /// with the specified number of border modules. The string always uses

+ 0 - 87
QRCodeGenLib/src/QRCodeGen/QlpQrCode.pas

@@ -331,63 +331,6 @@ type
     /// </remarks>
     function ToBitmapImage(AScale, ABorder: Int32): TQRCodeGenLibBitmap;
 
-{$IF DEFINED(VCL_OR_LCL)}
-    /// <summary>
-    /// Returns a jpeg image depicting this QR Code, with the specified
-    /// module scale and border modules. For example, ToJpegImage(scale=10,
-    /// border=4) means to pad the QR Code with 4 white border modules on all
-    /// four sides, and use 10×10 pixels to represent each module. The
-    /// resulting image contains the colors specified by the backgroundcolor
-    /// (by default = FFFFFF) and foregroundcolor (by default = 000000)
-    /// properties.
-    /// </summary>
-    /// <param name="AScale">
-    /// the side length (measured in pixels, must be positive) of each module
-    /// </param>
-    /// <param name="ABorder">
-    /// the number of border modules to add, which must be non-negative
-    /// </param>
-    /// <returns>
-    /// a new jpeg image representing this QR Code, with padding and scaling
-    /// </returns>
-    /// <exception cref="QlpQRCodeGenLibTypes|EArgumentOutOfRangeQRCodeGenLibException">
-    /// if the scale or border is out of range, or if <br />{AScale, ABorder,
-    /// FSize} cause the image dimensions to exceed System.High(Int32)
-    /// </exception>
-    /// <remarks>
-    /// <b>The caller is responsible for the lifetime of the returned image
-    /// object.</b>
-    /// </remarks>
-    function ToJpegImage(AScale, ABorder: Int32): TQRCodeGenLibJPEGImage;
-
-    /// <summary>
-    /// Returns a png image depicting this QR Code, with the specified
-    /// module scale and border modules. For example, ToPngImage(scale=10,
-    /// border=4) means to pad the QR Code with 4 white border modules on all
-    /// four sides, and use 10×10 pixels to represent each module. The
-    /// resulting image contains the colors specified by the backgroundcolor
-    /// (by default = FFFFFF) and foregroundcolor (by default = 000000)
-    /// properties.
-    /// </summary>
-    /// <param name="AScale">
-    /// the side length (measured in pixels, must be positive) of each module
-    /// </param>
-    /// <param name="ABorder">
-    /// the number of border modules to add, which must be non-negative
-    /// </param>
-    /// <returns>
-    /// a new png image representing this QR Code, with padding and scaling
-    /// </returns>
-    /// <exception cref="QlpQRCodeGenLibTypes|EArgumentOutOfRangeQRCodeGenLibException">
-    /// if the scale or border is out of range, or if <br />{AScale, ABorder,
-    /// FSize} cause the image dimensions to exceed System.High(Int32)
-    /// </exception>
-    /// <remarks>
-    /// <b>The caller is responsible for the lifetime of the returned image
-    /// object.</b>
-    /// </remarks>
-    function ToPngImage(AScale, ABorder: Int32): TQRCodeGenLibPNGImage;
-{$IFEND VCL_OR_LCL}
     /// <summary>
     /// Returns a string of SVG code for an image depicting this QR Code,
     /// with the specified number of border modules. The string always uses
@@ -1215,36 +1158,6 @@ begin
 {$IFEND}
 end;
 
-{$IF DEFINED(VCL_OR_LCL)}
-
-function TQrCode.ToJpegImage(AScale, ABorder: Int32): TQRCodeGenLibJPEGImage;
-var
-  LBitmap: TQRCodeGenLibBitmap;
-begin
-  LBitmap := ToBitmapImage(AScale, ABorder);
-  Result := TQRCodeGenLibJPEGImage.Create;
-  Result.CompressionQuality := 99;
-  try
-    Result.Assign(LBitmap);
-  finally
-    LBitmap.Free;
-  end;
-end;
-
-function TQrCode.ToPngImage(AScale, ABorder: Int32): TQRCodeGenLibPNGImage;
-var
-  LBitmap: TQRCodeGenLibBitmap;
-begin
-  LBitmap := ToBitmapImage(AScale, ABorder);
-  Result := TQRCodeGenLibPNGImage.Create;
-  try
-    Result.Assign(LBitmap);
-  finally
-    LBitmap.Free;
-  end;
-end;
-{$IFEND VCL_OR_LCL}
-
 function TQrCode.ToSvgString(ABorder: Int32): String;
 var
   LColumn, LRow: Int32;

+ 2 - 7
QRCodeGenLib/src/Utils/QlpQRCodeGenLibTypes.pas

@@ -7,8 +7,6 @@ interface
 uses
 {$IF DEFINED(VCL)}
   Vcl.Graphics,
-  Vcl.Imaging.jpeg, // for VCL JPEG Support
-  Vcl.Imaging.pngimage, // for VCL PNG Support
 {$ELSEIF DEFINED(FMX)}
   FMX.Graphics,
   UIConsts,
@@ -103,15 +101,12 @@ type
   TQRCodeGenLibBitmap = TFPCompactImgRGB16Bit;
 {$ELSE}
   TQRCodeGenLibBitmap = TBitmap;
-{$IFNDEF FMX}
-  TQRCodeGenLibJPEGImage = TJPEGImage;
-  TQRCodeGenLibPNGImage =
-{$IFDEF LCL}TPortableNetworkGraphic{$ELSE}TPngImage{$ENDIF LCL};
-{$ELSE}
+{$IFDEF FMX}
   TQRCodeGenLibBitmapData = TBitmapData;
   TQRCodeGenLibMapAccess = TMapAccess;
 {$ENDIF FMX}
 {$ENDIF FCL}
+  // ===========//
 {$IFDEF VCL}
 
 const