向大家请教GDI+的图像文件的打开(bmp,jpg)
图像文件的格式转换
图像的缩放(包括区域缩放,窗口放大显示)最好有源代码,多谢
图像文件的格式转换
图像的缩放(包括区域缩放,窗口放大显示)最好有源代码,多谢
解决方案 »
- winhttp的代理支持?
- 私有枚举类型为何不能被友员函数调用?
- 急急急急急急急急急急急急急急急急急急急急急急 高手请进啊!
- 如何判断完全进入Win2k系统?
- 新手请教关于界面设计的问题
- 关于文件操作,实现文件的创建填充使用什么函数比较好,考虑到程序的效率和安全性
- 怎样在new document 的时候new一个pDocTemplate 中的特定一个出来(里面详细)
- vc2010 在XP下编译,运行正常的程序在WIN7下闪退,为什么?
- 设备坐标和逻辑坐标到底是怎么一回事呀?
- 请问如何能让win9x自动登录??!
- 怎样让窗体总是浮在其他窗体之上?(always on top)
- 进程间发送消息---急急
Image image("ddd.jpg")
就可以了。
可以用DBI实现JPJ和BMP的转换
http://chs.gotdotnet.com/quickstart/winforms/doc/WinFormsGDIPlus.aspx
http://msdn.microsoft.com/library/en-us/gdicpp/GDIPlus/usingGDIPlus.asp?frame=true
其中的Using Image Encoders and Decoders有图片格式转换的例子。
其中的Using Images, Bitmaps, and Metafiles有缩放图片和显示图片的例子。
我自己写的因为牵涉到很多图像处理的图形生成的算法,暂不能提供.
我只需要如下的功能
图像文件的打开(bmp,jpg)
图像文件的格式转换
图像的缩放(包括区域缩放,窗口放大显示)其他的都不用你可以删掉我不要的功能多谢!
窗口放大显示 是啥意思啊?能说明一下吗?
,忙活了几个小时说明一下:
1。 另存文件的ico, emf,wmf可能不管用,可能要增加代码来实现。目前没时间测试
2。 缩放图像的时候图像闪烁2下,属正常现象,来不及更改,要想不闪烁,可以采用双缓冲
3。 rubber zoom 因为时间关系没有作,打算明天完成再发给你
4。据说有些老格式的tiff无法加载,属于GDI+的bug,跟我无关,^_^
4。 可能有其他小错误来不及测试发现,请见谅。太忙时间太少。请通知我以便于改正。 老王
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/摘抄的缩放例子!
Image image(L"Apple.gif");
UINT width = image.GetWidth();
UINT height = image.GetHeight();
// Make the destination rectangle 30 percent wider and
// 30 percent taller than the original image.
// Put the upper-left corner of the destination
// rectangle at (150, 20).
Rect destinationRect(150, 20, 1.3 * width, 1.3 * height);
// Draw the image unaltered with its upper-left corner at (0, 0).
graphics.DrawImage(&image, 0, 0);
// Draw a portion of the image. Scale that portion of the image
// so that it fills the destination rectangle.
graphics.DrawImage(
&image,
destinationRect,
0, 0, // upper-left corner of source rectangle
0.75 * width, // width of source rectangle
0.75 * height, // height of source rectangle
UnitPixel);