RasterSaveDialogFormatFlags Enumeration

Summary
The options a format supports.
Syntax
C#
C++/CLI
[FlagsAttribute()] 
public enum RasterSaveDialogFormatFlags 
[FlagsAttribute()] 
public enum class RasterSaveDialogFormatFlags : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable   
Members
Value Member Description
0x00000000 None The format does not support any special options.
0x00000001 Progressive The format supports Progressive Passes.
0x00000002 CmpQualityFactorPredefined The format supports the predefined Cmp Quality Factor, Leadtools.Codecs.CodecsCmpQualityFactorPredefined.
0x00000004 QualityFactor The format supports the Quality Factor.
0x00000008 MultiPage The format supports Multipage options.
0x00000010 Stamp The format supports Stamp options.
0x00000020 LosslessJpeg The format supports the Lossless JPEG compression.
0x00000040 Jpeg2000Basic The format supports basic Jpeg2000 options.
0x00000080 Jpeg2000Advanced The format supports advanced Jpeg2000 options.
0x00000100 PngQualityFactor The format supports a quality factor between (0-9).
0x00000800 Jpeg2000AlphaChannel The format supports JPEG 2000 alpha channels
0x00001000 Jbig2Support The format supports JBIG2 options.
0x00002000 XpsPngQualityFactor The format supports a quality factor between (0-9).
0x00004000 XpsJpegQualityFactor The format supports a quality factor between (0, 2-255).
0x00008000 PdfProfiles The format supports PDF Profiles.
0x00010000 BigTiff The format supports Big Tiff.
0x00020000 Jbig2QualityFactor The format supports a quality factor (0 for Jbig2 lossless and 2 for Jbig2 near lossless)
0x00040000 HeicQualityFactor The format supports HEIF/HEIC formats quality factor.
0x00080000 WebpQualityFactor The format supports WebP quality factor.
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.WinForms.CommonDialogs.File; 
 
 
public void RasterSaveDialogExample() 
{ 
   RasterCodecs rasterCodecs = new RasterCodecs(); 
 
   RasterSaveDialog saveDlg = new RasterSaveDialog(rasterCodecs); 
   RasterSaveDialogFileFormatsList saveDlgFormatList = new RasterSaveDialogFileFormatsList(RasterDialogFileFormatDataContent.User); 
 
   // Adding Cmp format 
   saveDlgFormatList.Add(RasterDialogFileTypesIndex.Lead, RasterDialogBitsPerPixelDataContent.Default); 
 
   // Adding Tiff format 
   saveDlgFormatList.Add(RasterDialogFileTypesIndex.Tiff, RasterDialogBitsPerPixelDataContent.User); 
   saveDlgFormatList[1].Name = "Custom Tiff"; 
 
   //Adding all default 12-bit subtypes 
   saveDlgFormatList[1].BitsPerPixelList.Add(RasterDialogFileTypesIndex.Tiff, 12, RasterDialogFileSubTypeDataContent.Default); 
 
   //Adding all default 24-bit and some subtypes 
   saveDlgFormatList[1].BitsPerPixelList.Add(RasterDialogFileTypesIndex.Tiff, 24, RasterDialogFileSubTypeDataContent.User); 
   saveDlgFormatList[1].BitsPerPixelList[1].SubFormatsList.Add(RasterDialogFileTypesIndex.Tiff, 24, (int)RasterDialogTiff24SubTypesIndex.UncompressedYCbCr); 
   saveDlgFormatList[1].BitsPerPixelList[1].SubFormatsList.Add(RasterDialogFileTypesIndex.Tiff, 24, (int)RasterDialogTiff24SubTypesIndex.PackbitsRgb); 
   saveDlgFormatList[1].BitsPerPixelList[1].SubFormatsList.Add(RasterDialogFileTypesIndex.Tiff, 24, (int)RasterDialogTiff24SubTypesIndex.PackbitsCmyk); 
 
   saveDlg.AutoProcess = false; 
   saveDlg.BitsPerPixel = 24; 
   saveDlg.DefaultExt = "cmp"; 
   saveDlg.EnableSizing = true; 
   saveDlg.FileFormatsList = saveDlgFormatList; 
   saveDlg.FileName = "Out_Image1.cmp"; 
   saveDlg.FileSubTypeIndex = (int)RasterDialogCmpSubTypesIndex.NonProgressive; 
   saveDlg.FileTypeIndex = RasterDialogFileTypesIndex.Lead; 
   saveDlg.InitialDirectory = LEAD_VARS.ImagesDir; 
   saveDlg.InitialView = FileDialogInitialView.List; 
   saveDlg.PageNumber = 1; 
   saveDlg.Passes = 1; 
   saveDlg.PromptOverwrite = true; 
   saveDlg.QualityFactor = 2; 
   saveDlg.ShowFileOptionsBasicJ2kOptions = false; 
   saveDlg.ShowFileOptionsJ2kOptions = false; 
   saveDlg.ShowFileOptionsMultipage = true; 
   saveDlg.ShowFileOptionsProgressive = true; 
   saveDlg.ShowFileOptionsQualityFactor = true; 
   saveDlg.ShowFileOptionsStamp = true; 
   saveDlg.ShowPdfProfiles = true; 
   saveDlg.ShowBitsPerPixel = true; 
   saveDlg.ShowFormatSubType = true; 
   saveDlg.ShowHelp = true; 
   saveDlg.ShowOptions = true; 
   saveDlg.ShowQualityFactor = true; 
   saveDlg.StampBitsPerPixel = 24; 
   saveDlg.StampHeight = 120; 
   saveDlg.StampWidth = 120; 
   saveDlg.Title = "Save Dialog"; 
   saveDlg.WithStamp = false; 
   saveDlg.Help += new EventHandler<RasterDialogHelpEventArgs>(saveDlg_Help); 
 
   // Replace "Cancel" string with "Cancel Save" 
   RasterSaveDialog.SetDialogString(new RasterDialogStrings("Cancel Save", RasterDialogStringsId.SaveCancel)); 
 
   if (DialogResult.OK == saveDlg.ShowDialog(null)) 
   { 
      Leadtools.RasterImage saveImage = rasterCodecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp")); 
 
      switch (saveDlg.Format) 
      { 
         case RasterImageFormat.Abc: 
            { 
               rasterCodecs.Options.Abc.Save.QualityFactor = saveDlg.AbcQualityFactor; 
               break; 
            } 
 
         case RasterImageFormat.Png: 
            { 
               rasterCodecs.Options.Png.Save.QualityFactor = saveDlg.QualityFactor; 
               break; 
            } 
 
         case RasterImageFormat.Cmp: 
            { 
               rasterCodecs.Options.Jpeg.Save.QualityFactor = saveDlg.QualityFactor; 
               rasterCodecs.Options.Jpeg.Save.CmpQualityFactorPredefined = saveDlg.CmpQualityFactor; 
               break; 
            } 
 
         default: 
            { 
               rasterCodecs.Options.Jpeg.Save.QualityFactor = saveDlg.QualityFactor; 
               break; 
            } 
      } 
 
      rasterCodecs.Options.Jpeg.Save.SaveWithStamp = saveDlg.WithStamp; 
      rasterCodecs.Options.Jpeg.Save.StampBitsPerPixel = saveDlg.StampBitsPerPixel; 
      rasterCodecs.Options.Jpeg.Save.StampWidth = saveDlg.StampWidth; 
      rasterCodecs.Options.Jpeg.Save.StampHeight = saveDlg.StampHeight; 
 
      rasterCodecs.Save(saveImage, 
                    saveDlg.FileName, 
                    saveDlg.Format, 
                    saveDlg.BitsPerPixel, 
                    saveImage.Page, 
                    saveImage.Page, 
                    saveDlg.PageNumber, 
                    saveDlg.MultiPage); 
 
      RasterDialogStrings okButtonString = RasterSaveDialog.GetDialogString(RasterDialogStringsId.SaveCancel); 
      MessageBox.Show(okButtonString.ToString()); 
   } 
} 
 
public void saveDlg_Help(object sender, RasterDialogHelpEventArgs e) 
{ 
   switch (e.Dialog) 
   { 
      case RasterDialogHelpName.Save: 
         { 
            MessageBox.Show("Save dialog Help"); 
            break; 
         } 
 
      case RasterDialogHelpName.J2kOptions: 
         { 
            MessageBox.Show("Jpeg 2000 Save Options dialog Help"); 
            break; 
         } 
 
      case RasterDialogHelpName.SaveOptions: 
         { 
            MessageBox.Show("Save Options dialog Help"); 
            break; 
         } 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.WinForms.CommonDialogs.File Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.