关于
png_read_png(png_structp png_ptr, png_infop info_ptr,
                           int transforms,
                           voidp params)transforms是什么意思#define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */
#define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */
#define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */
#define PNG_TRANSFORM_PACKING        0x0004    /* read and write */
#define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */
#define PNG_TRANSFORM_EXPAND         0x0010    /* read only */
#define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */
#define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */
#define PNG_TRANSFORM_BGR            0x0080    /* read and write */
#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */
#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */
#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */
#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* WRITE only, deprecated */
/* Added to libpng-1.2.34 */
#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800  /* WRITE only */
#define PNG_TRANSFORM_STRIP_FILLER_AFTER  0x1000  /* WRITE only */
常用的宏有那些

解决方案 »

  1.   

    刚才看了一libpng的源代码,transforms在此函数里边只是作为bool值来判断,所以传值时传0或非0就可以。它的意思是PNG是否支持透明。
      

  2.   

    你最好有它的说明文档,否则很难使用的..
    那些lib很多宏,并且嵌套..没说明基本上看不明白的~~比较好的办法就是用那些架设在它上面的lib..例如CxImage..
    因为你只需调用CxImage里的函数就可以Read/Write,而无须去自己面对那大堆"天书"~~~