Leadtools TWAIN(Leadtools.Twainアセンブリ)

フレームを表示

GetJpegCompressionメソッド






流れかデフォルトの圧縮設定を取得するべきかどうかについて示すフラグ。
TWAINセッションの間現在やデフォルトのJPEG圧縮設定を取得します。
構文
public TwainJpegCompression GetJpegCompression( 
   bool defaultValues
)
'Declaration
 
Public Function GetJpegCompression( _
   ByVal defaultValues As Boolean _
) As TwainJpegCompression
'Usage
 
Dim instance As TwainSession
Dim defaultValues As Boolean
Dim value As TwainJpegCompression
 
value = instance.GetJpegCompression(defaultValues)

            

            
public:
TwainJpegCompression GetJpegCompression( 
   bool defaultValues
) 

パラメーター

defaultValues
流れかデフォルトの圧縮設定を取得するべきかどうかについて示すフラグ。

戻り値

指定されたTWAIN JPEG圧縮オプションを格納するTwainJpegCompressionオブジェクト。
解説
フラグパラメーターに渡されるフラグに従い、このメソッドは、現在やデフォルトのTWAIN JPEG圧縮設定を取得します。
詳細については、「TWAINソースでのJPEG圧縮の使用」を参照してください。
サンプル
Copy Code  
Imports Leadtools
 Imports Leadtools.Twain

#If Not LEADTOOLS_V19_OR_LATER Then
      Public Sub GetJpegCompressionExample(ByVal parent As IWin32Window)
#Else
      Public Sub GetJpegCompressionExample(ByVal parent As IntPtr)
#End If ' #If LEADTOOLS_V19_OR_LATER Then
         Dim session As TwainSession = New TwainSession()
         session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
         Dim jpegdata As String
         Try
            Dim twainJpeg As TwainJpegCompression = session.GetJpegCompression(False)
            Dim quantMap As Integer() = twainJpeg.GetQuantizationMap()
            Dim haffmanMap As Integer() = twainJpeg.GetHuffmanMap()
            Dim quantTable As TwainMemoryData() = twainJpeg.GetQuantizationTable()
            Dim haffmanDC As TwainMemoryData() = twainJpeg.GetHuffmanDC()
            Dim haffmanAC As TwainMemoryData() = twainJpeg.GetHuffmanAC()

            jpegdata = String.Format("Color Space = {0}" & Constants.vbLf & "QuantMap = {1}" & Constants.vbLf & "GetHuffmanMap = {2}" & Constants.vbLf & "GetQuantTable Flags = {3}" & Constants.vbLf & "GetQuantTable Length = {4}" & _
                  Constants.vbLf & "GetQuantTable Data = {5}" & Constants.vbLf & "GetHuffmanDC Flags = {6}" & Constants.vbLf & "GetHuffmanDC Data = {7}" & Constants.vbLf & "GetHuffmanAC Flags = {8}" & Constants.vbLf & "GetHuffmanAC Data = {9}" & _
                  Constants.vbLf, 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 ex As Exception
            MessageBox.Show(ex.Message)
         End Try

         session.Shutdown()
      End Sub
using Leadtools;
 using Leadtools.Twain;

#if !LEADTOOLS_V19_OR_LATER
      public void GetJpegCompressionExample(IWin32Window parent)
#else
      public void GetJpegCompressionExample(IntPtr parent)
#endif // #if !LEADTOOLS_V19_OR_LATER
      {
         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();
      }
必要条件

ターゲットプラットホーム

参照

参照

TwainSessionクラス
TwainSessionメンバ
SetJpegCompressionメソッド