DefaultBitsPerPixel Property

Summary
Gets or sets the default bits per pixel that will be selected in the Save dialog box whenever this format is selected.
Syntax
C#
C++/CLI
public int DefaultBitsPerPixel { get; set; } 
public: 
property int DefaultBitsPerPixel { 
   int get(); 
   void set (    int value); 
} 

Property Value

The default bits per pixel that will be selected in the Save dialog box whenever this format is selected.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.WinForms.CommonDialogs.File; 
 
 
public void RasterSaveDialogExample2() 
{ 
   RasterCodecs rasterCodecs = new RasterCodecs(); 
 
   RasterSaveDialog saveDlg = new RasterSaveDialog(rasterCodecs); 
   RasterSaveDialogFileFormatsList defaultFormats = new RasterSaveDialogFileFormatsList(RasterDialogFileFormatDataContent.Default); 
 
   //Some languages use RasterSaveDialogFileFormatsList.Item property to access the list indexer. In C#, the square brackets [] are used 
   RasterSaveDialogFileFormat lastFormat = defaultFormats[defaultFormats.Count-1]; 
 
   Console.WriteLine($"Default BPP of last format is: {lastFormat.DefaultBitsPerPixel}"); 
   Console.WriteLine($"Extension of last format is: {lastFormat.Extension}"); 
 
   RasterSaveDialogBitsPerPixelList bppList = lastFormat.BitsPerPixelList; 
 
   //Some languages use RasterSaveDialogBitsPerPixelList.Item property to access the list indexer. In C#, the square brackets [] are used 
   RasterSaveDialogBitsPerPixel lastBPP = bppList[bppList.Count - 1]; 
 
 
   Console.WriteLine($"Default extension for last BPP value is : {lastBPP.DefaultExtension}"); 
   Console.WriteLine($"Default SubFormat index for last BPP value is : {lastBPP.DefaultSubFormatIndex}"); 
   Console.WriteLine($"Flags for last BPP value : {lastBPP.Flags}"); 
 
   RasterSaveDialogSubTypesList subFormats = lastBPP.SubFormatsList; 
 
   //Some languages use RasterSaveDialogSubTypesList.Item property to access the list indexer. In C#, the square brackets [] are used 
   RasterSaveDialogFileSubType lastSubFormat = subFormats[subFormats.Count - 1]; 
 
   Console.WriteLine($"Extension for last sub-format is : {lastSubFormat.Extension}"); 
   Console.WriteLine($"Format Flags for last sub-format : {lastSubFormat.FormatFlags}"); 
 
   saveDlg.FileFormatsList = defaultFormats; 
 
   saveDlg.ShowFileOptionsBasicJ2kOptions = true; 
   saveDlg.ShowFileOptionsJbig2Options = true; 
   saveDlg.ShowOptions = true; 
   if (saveDlg.ShowDialog(null) != DialogResult.OK) 
      return; 
   switch (saveDlg.Format) 
   { 
      case RasterImageFormat.Jbig2: 
         rasterCodecs.Options.Jbig2.Save.EnableDictionary = saveDlg.FileJbig2Options.EnableDictionary; 
         break; 
      case RasterImageFormat.J2k: 
      case RasterImageFormat.Jp2: 
         // also other formats that use wavelet compression such as Cmw, TifJ2k, TifJ2k and TifCmw 
         rasterCodecs.Options.Jpeg2000.Save.CompressionControl = saveDlg.FileJ2kOptions.CompressionControl; 
         break; 
      case RasterImageFormat.Gif: 
         rasterCodecs.Options.Gif.Save.Interlaced = saveDlg.Interlaced; 
         break; 
   } 
} 
Requirements

Target Platforms

Help Version 23.0.2024.7.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.