怎样修改 tif 图像分辨率?

冬天-来了 2014-09-01 05:23:40
程序中生成了400dpi 的bmp图像,通过CImage类的Save函数转换图像格式为 tif 后,分辨率就变成 96 dpi了,不知道为什么,怎样把 tif图像分辨率转换为 400呢??
...全文
3694 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
冬天-来了 2014-09-02
  • 打赏
  • 举报
回复
引用 2 楼 robertbo 的回复:
在save之前使用 SetXDPI(400); SetYDPI(400); 就可以了
没有那个成员函数啊?用不了
阿呆_ 2014-09-02
  • 打赏
  • 举报
回复
你可以下载win32版本的tiff库进行安装 或者下载源代码然后手工将其中的.c/.cpp加入你的工程一起编译(也许需要手工设置一些MACRO, 看.h中设置咯)
冬天-来了 2014-09-02
  • 打赏
  • 举报
回复
我的是 Visual Studio2008,XP系统,莫非不能用libtiff ?
阿呆_ 2014-09-02
  • 打赏
  • 举报
回复
Building the Software under Windows 95/98/NT/2000 with MS VC++ With Microsoft Visual C++ installed, and properly configured for commandline use (you will likely need to source VCVARS32.BAT in AUTOEXEC.bAT or somewhere similar) you should be able to use the provided makefile.vc. C:\LIBTIFF\LIBTIFF> nmake /f makefile.vc C:\LIBTIFF\LIBTIFF> cd ..\tools C:\LIBTIFF\TOOLS> nmake /f makefile.vc This will build the library file LIBTIFF\LIBTIFF\LIBTIFF.LIB. This can be used in Win32 programs. If used in a project using the /MD compiler switch (using the runtime C library), it may be necessary to modify the CFLAGS macro in makefile.vc to correspond. The makefile also builds a DLL (libtiff.dll) with an associated import library (libtiff_i.lib). Any builds using libtiff will need to include the LIBTIFF\LIBTIFF directory in the include path. The libtiff\tools\makefile.vc should build .exe's for all the standard TIFF tool programs. NOTE: The contents of the contrib/win32 directory should no longer be needed, and are kept in the distribution temporarily.
冬天-来了 2014-09-02
  • 打赏
  • 举报
回复
引用 1 楼 Idle_ 的回复:
用libtiff自己生成.tif文件吧,这样你可以手工设置文件中的DPI,这里这里有bmp生成tiff的例子
有没有libtiff文件及配置方法,我弄了好久也配置不成功
阿呆_ 2014-09-02
  • 打赏
  • 举报
回复
引用 3 楼 zhenyang23 的回复:
[quote=引用 2 楼 robertbo 的回复:] 在save之前使用 SetXDPI(400); SetYDPI(400); 就可以了
没有那个成员函数啊?用不了[/quote] 他说的可能是用第三方库CxImage, 里面有SetXDPI/SetYDPI
robertbo 2014-09-01
  • 打赏
  • 举报
回复
在save之前使用 SetXDPI(400); SetYDPI(400); 就可以了
阿呆_ 2014-09-01
  • 打赏
  • 举报
回复
用libtiff自己生成.tif文件吧,这样你可以手工设置文件中的DPI,这里这里有bmp生成tiff的例子

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧