• 大小: 1.98MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-05
  • 语言: ASP
  • 标签: CxImage  

资源简介

1. 下载CxImage包 2. 解压,编译档夹下的所有dsw檔。 3. 搜索到所有的lib档,在你的过程目录下新建个文件夹就叫做CxImageLib吧, 把搜索到的lib文件copy到CxImageLib活页夹下。 4. 在你的工程文件夹下新建一个档夹,就叫做CxImageHeadFile吧, 把CxImage活页夹下的xfile.h ximadefs.h xiofile.h xmenfile.h 四个文件 copy到CxImagefile活页夹里面。 5. 在你的工程的stdafx.h 档里面添加以下几行: #include "ximage.h" //#pragma comment(lib,"lib/cximagecrtd.lib") //静态链接库时使用 #pragma comment(lib,"cximage.lib") #pragma comment(lib,"Jpeg.lib") #pragma comment(lib,"png.lib ") #pragma comment(lib,"zlib.lib ") #pragma comment(lib,"tiff.lib ") #pragma comment(lib,"jasper.lib ") #pragma comment(lib,"j2k.lib ") #pragma comment(lib,"jbig.lib ") 6. ok,编译就可用通过了。试试看行不行:先添加一个消息响应函数。 在里面写上几句: CxImage image; if( !image.Load("image.bmp", CXIMAGE_FORMAT_BMP)) { return }; if (image.IsValid()) { image.Save("image.tif",CXIMAGE_FORMAT_TIF); }

资源截图

代码片段和文件信息

/*
 * TIFF file IO using CxFile.
 */

#ifdef WIN32
 #include 
#endif
#include 

#include “ximage.h“

#if CXIMAGE_SUPPORT_TIF

#include “../tiff/tiffiop.h“

#include “xfile.h“

static tsize_t 
_tiffReadProcEx(thandle_t fd tdata_t buf tsize_t size)
{
return ((CxFile*)fd)->Read(buf 1 size);
}

static tsize_t
_tiffWriteProcEx(thandle_t fd tdata_t buf tsize_t size)
{
return ((CxFile*)fd)->Write(buf 1 size);
}

static toff_t
_tiffSeekProcEx(thandle_t fd toff_t off int whence)
{
if ( off == 0xFFFFFFFF ) 
return 0xFFFFFFFF;
if (!((CxFile*)fd)->Seek(off whence))
return 0xFFFFFFFF;
if (whence == SEEK_SET)
return off;

return (toff_t)((CxFile*)fd)->Tell();
}

// Return nonzero if error
static int
_tiffCloseProcEx(thandle_t fd)
{
// return !((CxFile*)fd)->Close(); // “//“ needed for memory files 
return 0;
}

#include 

static toff_t
_tiffSizeProcEx(thandle_t fd)
{
return ((CxFile*)fd)->Size();
}

static int
_tiffMapProcEx(thandle_t fd tdata_t* pbase toff_t* psize)
{
return (0);
}

static void
_tiffUnmapProcEx(thandle_t fd tdata_t base toff_t size)
{
}

// Open a TIFF file descriptor for read/writing.
/*
TIFF*
TIFFOpen(const char* name const char* mode)
{
static const char module[] = “TIFFOpen“;
   FILE* stream = fopen(name mode);
if (stream == NULL) 
   {
TIFFError(module “%s: Cannot open“ name);
return NULL;
}
return (TIFFFdOpen((int)stream name mode));
}
*/

TIFF*
_TIFFFdOpen(int fd const char* name const char* mode)
{
TIFF* tif;

tif = TIFFClientOpen(name mode
    (thandle_t) fd
    _tiffReadProcEx _tiffWriteProcEx _tiffSeekProcEx _tiffCloseProcEx
    _tiffSizeProcEx _tiffMapProcEx _tiffUnmapProcEx);
if (tif)
tif->tif_fd = fd;
return (tif);
}

extern “C“ TIFF* _TIFFOpenEx(CxFile* stream const char* mode)
{
return (_TIFFFdOpen((int)stream “TIFF IMAGE“ mode));
}

#ifdef __GNUC__
extern char* malloc();
extern char* realloc();
#else
#include 
#endif

tdata_t
_TIFFmalloc(tsize_t s)
{
return (malloc((size_t) s));
}

void
_TIFFfree(tdata_t p)
{
free(p);
}

tdata_t
_TIFFrealloc(tdata_t p tsize_t s)
{
return (realloc(p (size_t) s));
}

void
_TIFFmemset(tdata_t p int v tsize_t c)
{
memset(p v (size_t) c);
}

void
_TIFFmemcpy(tdata_t d const tdata_t s tsize_t c)
{
memcpy(d s (size_t) c);
}

int
_TIFFmemcmp(const tdata_t p1 const tdata_t p2 tsize_t c)
{
return (memcmp(p1 p2 (size_t) c));
}

static void
Win32WarningHandler(const char* module const char* fmt va_list ap)
{
#ifdef _DEBUG
#if (!defined(_CONSOLE) && defined(WIN32))
LPTSTR sztitle;
LPTSTR szTmp;
LPCTSTR sztitleText = “%s Warning“;
LPCTSTR szDefaultModule = “TIFFLIB“;
szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module;
if ((sztitle = (LPTSTR)LocalAlloc(LMEM_FIXED (lstrlen(szTmp) +
lstrlen(sz

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2005-03-12 15:33  CXImage\
     目录           0  2004-11-14 15:13  CXImage\www.cnzz.cn\
     文件        8977  2003-07-23 01:09  CXImage\www.cnzz.cn\layers.jpg
     文件       44461  2004-01-31 12:27  CXImage\www.cnzz.cn\cximage_reference.htm
     目录           0  2004-11-14 15:13  CXImage\www.cnzz.cn\jpeg\
     文件        1712  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jconfig.h
     文件        8339  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jdhuff.h
     文件        3341  2002-08-18 17:05  CXImage\www.cnzz.cn\jpeg\jinclude.h
     文件       16104  2002-08-18 17:05  CXImage\www.cnzz.cn\jpeg\jpegint.h
     文件         374  2002-08-18 17:05  CXImage\www.cnzz.cn\jpeg\jversion.h
     文件        6042  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jcapistd.c
     文件       15305  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jccolor.c
     文件       29131  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jchuff.c
     文件        9461  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jcmainct.c
     文件       20479  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jcmaster.c
     文件       21885  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jcparam.c
     文件       12427  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jcprepct.c
     文件         531  2003-03-23 15:27  CXImage\www.cnzz.cn\jpeg\Jpeg.dsw
     文件        6106  2003-03-23 15:27  CXImage\www.cnzz.cn\jpeg\Jpeg.dsp
     文件        9501  1998-03-27 18:35  CXImage\www.cnzz.cn\jpeg\change.log
     文件       20330  1998-03-27 18:35  CXImage\www.cnzz.cn\jpeg\Readme.txt
     文件       14365  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jctrans.c
     文件        9623  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jdapistd.c
     文件        7816  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jdatasrc.c
     文件       13412  2003-02-17 21:30  CXImage\www.cnzz.cn\jpeg\jdcolor.c
     文件       23362  2003-01-16 23:29  CXImage\www.cnzz.cn\jpeg\jdhuff.c
     文件       20878  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jdmainct.c
     文件       20267  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jdmaster.c
     文件       21227  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jdphuff.c
     文件       16859  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jdsample.c
     文件        8053  2002-08-18 17:04  CXImage\www.cnzz.cn\jpeg\jerror.c
............此处省略480个文件信息

评论

共有 条评论

相关资源