本文整理汇总了C++中CxImageTIF::Ghost方法的典型用法代码示例。如果您正苦于以下问题:C++ CxImageTIF::Ghost方法的具体用法?C++ CxImageTIF::Ghost怎么用?C++ CxImageTIF::Ghost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CxImageTIF
的用法示例。
在下文中一共展示了CxImageTIF::Ghost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Encode
////////////////////////////////////////////////////////////////////////////////
// Thanks to Abe <God(dot)bless(at)marihuana(dot)com>
bool CxImageTIF::Encode(CxFile * hFile, CxImage ** pImages, int pagecount)
{
try{
if (hFile==NULL) throw "invalid file pointer";
if (pImages==NULL || pagecount==0) throw "multipage TIFF, no images!";
CxImageTIF ghost;
for (int i=1; i<=pagecount; i++){
if (pImages[i-1]==NULL) throw "Bad image pointer";
ghost.Ghost(pImages[i-1]);
if (!ghost.Encode(hFile,true)) throw "Error saving TIFF file";
}
} catch (char *message) {
strncpy(info.szLastError,message,255);
return false;
}
return true;
}
示例2: Encode
/**
* Saves to disk or memory pagecount images, referenced by an array of CxImage pointers.
* \param hFile: file handle (CxMemFile or CxIOFile), with write access.
* \param pImages: array of CxImage pointers.
* \param pagecount: number of images.
* \param imagetype: can be CXIMAGE_FORMAT_TIF, CXIMAGE_FORMAT_GIF or CXIMAGE_FORMAT_ICO.
* \return true if everything is ok
*/
bool CxImage::Encode(CxFile * hFile, CxImage ** pImages, int32_t pagecount, uint32_t imagetype)
{
#if CXIMAGE_SUPPORT_TIF
if (imagetype==CXIMAGE_FORMAT_TIF){
CxImageTIF newima;
newima.Ghost(this);
if (newima.Encode(hFile,pImages,pagecount)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_GIF
if (imagetype==CXIMAGE_FORMAT_GIF){
CxImageGIF newima;
newima.Ghost(this);
if (newima.Encode(hFile,pImages,pagecount)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_ICO
if (imagetype==CXIMAGE_FORMAT_ICO){
CxImageICO newima;
newima.Ghost(this);
if (newima.Encode(hFile,pImages,pagecount)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
strcpy(info.szLastError,"Multipage Encode, Unsupported operation for this format");
return false;
}
示例3: Encode
/**
* Saves to disk the image in a specific format.
* \param hFile: file handle (CxMemFile or CxIOFile), with write access.
* \param imagetype: file format, see ENUM_CXIMAGE_FORMATS
* \return true if everything is ok
* \sa ENUM_CXIMAGE_FORMATS
*/
bool CxImage::Encode(CxFile *hFile, DWORD imagetype)
{
#if CXIMAGE_SUPPORT_BMP
if (imagetype==CXIMAGE_FORMAT_BMP){
CxImageBMP newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_ICO
if (imagetype==CXIMAGE_FORMAT_ICO){
CxImageICO newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_TIF
if (imagetype==CXIMAGE_FORMAT_TIF){
CxImageTIF newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_JPG
if (imagetype==CXIMAGE_FORMAT_JPG){
CxImageJPG newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_GIF
if (imagetype==CXIMAGE_FORMAT_GIF){
CxImageGIF newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_PNG
if (imagetype==CXIMAGE_FORMAT_PNG){
CxImagePNG newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_MNG
if (imagetype==CXIMAGE_FORMAT_MNG){
CxImageMNG newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
return true;
} else {
strcpy(info.szLastError,newima.GetLastError());
return false;
}
}
#endif
#if CXIMAGE_SUPPORT_TGA
if (imagetype==CXIMAGE_FORMAT_TGA){
CxImageTGA newima;
newima.Ghost(this);
if (newima.Encode(hFile)){
//.........这里部分代码省略.........