GUID variable for JPEG,BMP,PNG

GUID variable for JPEG,BMP,PNG

本文关键字:BMP PNG JPEG variable for GUID      更新时间:2023-10-16

我想以JPEG格式存储图像。我正在使用它来创建图表。现在我想保存图表。函数名称 SaveAsImage(( 由需要 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);`

如您发布的代码中所述,缺少的信息记录在 CImage::Save 的文档中:

guidFileType
要将图像另存为的文件类型。可以是以下之一:

  • ImageFormatBMP未压缩的位图图像。
  • ImageFormatPNG可移植网络图形 (PNG( 压缩图像。
  • ImageFormatJPEGJPEG 压缩图像。
  • ImageFormatGIFGIF 压缩图像。

注意:有关常量的完整列表,请参阅 Windows SDK 中的图像文件格式常量。

这是指向图像文件格式常量完整列表的链接。