コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BarcodeImageConfiguration"/> class.
        /// </summary>
        /// <remarks>
        /// The mediastorage privilege (http://tizen.org/privilege/mediastorage) is needed if the image path is relevant to media storage.<br/>
        /// The externalstorage privilege (http://tizen.org/privilege/externalstorage) is needed if the image path is relevant to external storage.
        /// </remarks>
        /// <param name="size">The <see cref="Size"/> of the generated image.</param>
        /// <param name="path">The path to the file to be generated.</param>
        /// <param name="imageFormat">The format of the output image.</param>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     The width of <paramref name="size"/> is less than or equal to zero.<br/>
        ///     -or-<br/>
        ///     The height of <paramref name="size"/> is less than or equal to zero.
        /// </exception>
        /// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
        /// <exception cref="ArgumentException"><paramref name="imageFormat"/> is invalid.</exception>
        /// <example>
        /// <code>
        /// var imageConfig = new BarcodeImageConfiguration(new Size(500, 400), "/opt/usr/test-barcode-generate-new", BarcodeImageFormat.JPG);
        /// </code>
        /// </example>
        /// <since_tizen> 4 </since_tizen>
        public BarcodeImageConfiguration(Size size, string path, BarcodeImageFormat imageFormat)
        {
            if (size.Width <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(Size.Width), size.Width,
                                                      "width can't be less than or equal to zero.");
            }

            if (size.Height <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(Size.Height), size.Height,
                                                      "height can't be less than or equal to zero.");
            }

            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            ValidationUtil.ValidateEnum(typeof(BarcodeImageFormat), imageFormat, nameof(imageFormat));

            Size   = size;
            Path   = path;
            Format = imageFormat;
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BarcodeImageConfiguration"/> class.
 /// </summary>
 /// <remarks>
 /// The mediastorage privilege (http://tizen.org/privilege/mediastorage) is needed if the image path is relevant to media storage.<br/>
 /// The externalstorage privilege (http://tizen.org/privilege/externalstorage) is needed if the image path is relevant to external storage.
 /// </remarks>
 /// <param name="width">The width of the image to be generated.</param>
 /// <param name="height">The height of the image to be generated.</param>
 /// <param name="path">The path to the file to be generated.</param>
 /// <param name="imageFormat">The format of the output image.</param>
 /// <exception cref="ArgumentOutOfRangeException">
 ///     <paramref name="width"/> is less than or equal to zero.<br/>
 ///     -or-<br/>
 ///     <paramref name="height"/> is less than or equal to zero.
 /// </exception>
 /// <exception cref="ArgumentNullException"><paramref name="path"/> is null.</exception>
 /// <exception cref="ArgumentException"><paramref name="imageFormat"/> is invalid.</exception>
 /// <example>
 /// <code>
 /// var imageConfig = new BarcodeImageConfiguration(500, 400, "/opt/usr/test-barcode-generate-new", BarcodeImageFormat.JPG);
 /// </code>
 /// </example>
 /// <since_tizen> 4 </since_tizen>
 public BarcodeImageConfiguration(int width, int height, string path, BarcodeImageFormat imageFormat)
     : this(new Size(width, height), path, imageFormat)
 {
 }
コード例 #3
0
 internal static extern MediaVisionError GenerateImage(IntPtr engineCfg,
                                                       string message, int imageWidth, int imageHeight, BarcodeType type,
                                                       int qrEncMode, int qrEcc, int qrVersion, string imagePath, BarcodeImageFormat imageFormat);