←Select platform

ColorScheme Property

Summary
Gets or sets color space values.

Syntax
C#
C++/CLI
Python
public TwainColorScheme ColorScheme { get; set; } 
public: 
property TwainColorScheme ColorScheme { 
   TwainColorScheme get(); 
   void set (    TwainColorScheme ); 
} 
ColorScheme # get and set (TwainJpegCompression) 

Property Value

Gets or sets a value that indicates the color space in which the compressed components are stored. Only spaces supported by the source for TwainCapabilityType.ImageJpegPixelType are valid. This property is updated by calling the GetJpegCompression method. To set the JPEG Compression options, set this property and the other TwainJpegCompression properties and call the SetJpegCompression method.

Remarks

For more information, refer to Using JPEG Compression For A TWAIN Source. For more information about TW_JPEGCOMPRESSION, refer to the TWAIN specification.

Example
C#
using Leadtools; 
using Leadtools.Twain; 
 
 
public void GetJpegCompressionExample(IntPtr parent) 
{ 
   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   string jpegdata; 
   try 
   { 
      TwainJpegCompression twainJpeg = session.GetJpegCompression(false); 
      int[] quantMap = twainJpeg.GetQuantizationMap(); 
      int[] haffmanMap = twainJpeg.GetHuffmanMap(); 
      TwainMemoryData[] quantTable = twainJpeg.GetQuantizationTable(); 
      TwainMemoryData[] haffmanDC = twainJpeg.GetHuffmanDC(); 
      TwainMemoryData[] haffmanAC = twainJpeg.GetHuffmanAC(); 
 
      jpegdata = String.Format(@"Color Space = {0}\nQuantMap = {1}\nGetHuffmanMap = {2}\nGetQuantTable Flags = {3}\nGetQuantTable Length = {4}\nGetQuantTable Data = {5}\nGetHuffmanDC Flags = {6}\nGetHuffmanDC Data 
            = {7}\nGetHuffmanAC Flags = {8}\nGetHuffmanAC Data = {9}\n", 
                               twainJpeg.ColorScheme, 
                               quantMap[0], 
                               haffmanMap[0], 
                               quantTable[0].Flags, 
                               quantTable[0].Length, 
                               quantTable[0].Data, 
                               haffmanDC[0].Flags, 
                               haffmanDC[0].Data, 
                               haffmanAC[0].Flags, 
                               haffmanAC[0].Data); 
 
      MessageBox.Show(jpegdata); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
 
   session.Shutdown(); 
} 
Requirements

Target Platforms

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

Leadtools.Twain Assembly

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