示例#1
0
        public void Export(
            Image image
            , NuGenImageType imageType
            , NuGenImageFileFormat fileFormat
            , Size resolution
            , string path
            , string filename
            )
        {
            if (image == null)
            {
                throw new ArgumentNullException("image");
            }

            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }

            if (string.IsNullOrEmpty(filename))
            {
                throw new ArgumentNullException("filename");
            }

            image = NuGenControlPaint.GetThumbnail(image, resolution);

            if ((imageType & NuGenImageType.Color) != 0)
            {
                this.ExportToFileFormat(
                    image,
                    fileFormat,
                    path,
                    string.Format("{0}_Color", filename)
                    );
            }

            if ((imageType & NuGenImageType.Grayscale) != 0)
            {
                this.ExportToFileFormat(
                    NuGenControlPaint.GetDesaturatedImage(image),
                    fileFormat,
                    path,
                    string.Format("{0}_Grayscale", filename)
                    );
            }

            if ((imageType & NuGenImageType.Monochrome) != 0)
            {
                this.ExportToFileFormat(
                    NuGenControlPaint.GetMonochromeImage(image),
                    fileFormat,
                    path,
                    string.Format("{0}_Monochrome", filename)
                    );
            }
        }