2017-08-02 20 views
-1

イメージをJPEG形式で保存したいとします。私はthisをチャートの作成に使用しています。今私はチャートを保存したい。関数名SaveAsImage()は、GUIDパラメータを必要とするライブラリによって提供されます。ここでJPEG、BMP、PNGのGUID変数

はコードです:

私はJPEGのGUIDを初期化する必要がありますどのように?あなたが投稿したコードに記述したよう

  TChartString title = m_ChartSeriesDetail[i].seriesTitle; 
      m_ChartCtrl.Print(title, 0); 
      CRect rect; 
      GUID guid; 
      m_ChartCtrl.SaveAsImage((TChartString)m_ChartName, rect, 32, guid); 

////////////////////////////////////////////////////////////////////// //! 
Saves the chart to an image file 
    /** 
    This function is not available for VC6 and earlier. 
    @param strFilename 
     The name of the file in which to save the image. 
    @param rect 
     The size of the image. If an empty rectangle is provided, the 
     size of the chart on screen will be used (this results in an identical 
     image as what is seen on the screen). 
    @param nBPP 
     The numbers of bits per pixel in the bitmap. Usually 4, 8, 16, 24, or 32. 
    @param guidFileType 
     The file type to save the image as. See the CImage::Save in MSDN 
     for more information. 
**/ 
void SaveAsImage(const TChartString& strFilename, const CRect& rect, 
     int nBPP, REFGUID guidFileType= GUID_NULL);` 
+0

あなたの質問には*質問*がありません。 – WhozCraig

+0

申し訳ありませんが、どのようにjpegのGUIDを初期化する必要がありますか? –

+1

詳細については、「CImage :: Save in MSDN」を参照してください。そのドキュメントは、可能なパラメータが何であるかを正確に示しています。 – molbdnilo

答えて

1

は、不足している情報は、CImage::Saveのドキュメントに記載されています:

guidFileType
ファイルタイプをとして画像を保存します。次のいずれかになります。

  • ImageFormatBMP非圧縮ビットマップイメージ。
  • ImageFormatPNGポータブルネットワークグラフィック(PNG)圧縮イメージ。
  • ImageFormatJPEG JPEG圧縮画像。
  • ImageFormatGIF GIF圧縮画像。

注:定数の完全な一覧については、Windows SDKのイメージファイルの形式の定数を参照してください。

ここにはImage File Format Constantsの完全なリストへのリンクがあります。

関連する問題