GUID variable for JPEG,BMP,PNG
GUID variable for JPEG,BMP,PNG
我想以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( 压缩图像。ImageFormatJPEG
JPEG 压缩图像。ImageFormatGIF
GIF 压缩图像。注意:有关常量的完整列表,请参阅 Windows SDK 中的图像文件格式常量。
这是指向图像文件格式常量完整列表的链接。
相关文章:
- 在CToolBar对象中使用PNG时出现问题
- 为什么 BMP 图像上的 imwrite 会卡住/不返回?
- 从 bmp 文件数据创建 MFC CBitmap
- 从存储为 Windows 资源 (c++) 的 png 中获取 png 文件数据
- 将 bmp 文件加载到 TSpeedButton 中
- 使用 stbi_write_png,如何将 0 和 1 的矩形字节数组转换为单色 png 文件?
- 在C++中的SDL2窗口上显示.bmp时出现问题
- 将 FFMPEG 帧写入 png/jpeg 文件
- 将位图 (bmp) 转换为具有透明度的 png (Windows c++)
- 将 BMP 图像转换为灰度
- 如何启用libMagick++以保存.png文件格式
- Qt-png图像未显示在部署应用程序中
- 无法在CLion(macOS)上打开带有CImg的.png文件
- C++gdi::内存中的位图到PNG图像
- 当我调用它来解码 Blob 对象中的 png 图像时,"Magick++::readImages"引发警告
- GUID variable for JPEG,BMP,PNG
- 用C或C++读取/写入BMP/PNG灰度图像
- 使用C++(VS 2010)FAST将BMP保存为PNG
- 如何从bmp文件制作动画png
- 将bmp转换为png -访问违规写入位置