1ビットの白黒画像がきれいに表示されません。どうすればよいですか?

文書番号 : 32961     文書種別 : 使用方法     登録日 : 2012/12/07     最終更新日 : 2014/09/01
文書を印刷する
対象製品
LEADTOOLS 17.5J Imaging Pro
詳細
Imaging Proシリーズで1ビット画像を拡大・縮小表示した際に画質が低下するのは、1ビット画像のグレースケール表示機能(RasterPaintDisplayModeFlags列挙体の 「ScaleToGray」の機能)が無効になっているためです。
RasterPaintDisplayModeFlags列挙体の「ScaleToGray」はDocumentシリーズのみでサポートされている機能のため、Imaging Proシリーズでは適用することができません。

注意
製品版として認証した場合でも、アプリケーションにライセンス情報を組み込まないとトライアル版と同じくDocument シリーズやプラグイン製品でのみ使用可能な機能も確認できるようになっています。製品ヘルプの各解説部分に「Document シリーズのみ」、「xxxx Plug-In」と記載のある機能やファイル形式についてはImaging Pro シリーズでは使用できませんのでご注意ください。

Imaging Proシリーズで画質の低下を抑えるには、ColorResolutionCommandクラスを使用して1ビット画像を2ビット画像に変換し、Leadtools.Drawing.RasterPaintPropertiesのPaintDisplayModeプロパティに「Resample」もしくは「Bicubic」を設定する方法があります。

サンプルコード(VB.NET)
' 1ビット画像を2ビット画像に変換します。
Dim command As New Leadtools.ImageProcessing.ColorResolutionCommand()
command.BitsPerPixel = 2
command.Run(RasterImageViewer1.Image)

' 描画プロパティを設定します。
Dim properties As New Leadtools.Drawing.RasterPaintProperties()
properties = Leadtools.Drawing.RasterPaintProperties.Default
properties.PaintDisplayMode = Leadtools.Drawing.RasterPaintDisplayModeFlags.Bicubic
RasterImageViewer1.PaintProperties = properties

サンプルコード(C#)
// 1ビット画像を2ビット画像に変換します。
Leadtools.ImageProcessing.ColorResolutionCommand command = new Leadtools.ImageProcessing.ColorResolutionCommand();
command.BitsPerPixel = 2;
command.Run(rasterImageViewer1.Image);

// 描画プロパティを設定します。
Leadtools.Drawing.RasterPaintProperties properties = new Leadtools.Drawing.RasterPaintProperties();
properties = Leadtools.Drawing.RasterPaintProperties.Default;
properties.PaintDisplayMode = Leadtools.Drawing.RasterPaintDisplayModeFlags.Bicubic;
rasterImageViewer1.PaintProperties = properties;

※ 1ビット画像のビット数を2ビットに増やしていることや、描画プロパティの設定でResample/Bicubicなど高品質での表示となるため、デフォルト(None)の表示の場合やDocumentシリーズの機能(ScaleToGray)を使用した場合と比べてレスポンスは遅くなります。あらかじめご了承ください。
関連情報
キーワード
HowTo 問題 画像の表示 メモリ・遅い