向大家请教GDI+的图像文件的打开(bmp,jpg)
                图像文件的格式转换
                图像的缩放(包括区域缩放,窗口放大显示)最好有源代码,多谢

解决方案 »

  1.   


    Image image("ddd.jpg")
    就可以了。
      

  2.   

    自己写一个DBI,用streatchblt就可以实现缩放了
    可以用DBI实现JPJ和BMP的转换
      

  3.   

    介绍 GDI+
    http://chs.gotdotnet.com/quickstart/winforms/doc/WinFormsGDIPlus.aspx
      

  4.   

    请参考,
    http://msdn.microsoft.com/library/en-us/gdicpp/GDIPlus/usingGDIPlus.asp?frame=true
    其中的Using Image Encoders and Decoders有图片格式转换的例子。
    其中的Using Images, Bitmaps, and Metafiles有缩放图片和显示图片的例子。
      

  5.   

    codeguru和codeproject上有GDI+专题,有好多例子
    我自己写的因为牵涉到很多图像处理的图形生成的算法,暂不能提供.
      

  6.   

    asett1(asett1):
    我只需要如下的功能
                    图像文件的打开(bmp,jpg)
                    图像文件的格式转换
                    图像的缩放(包括区域缩放,窗口放大显示)其他的都不用你可以删掉我不要的功能多谢!
      

  7.   

    区域缩放 是 zoom view吗?还是放大镜?
    窗口放大显示 是啥意思啊?能说明一下吗?
      

  8.   

    zoom view就是把图像的部分区域放大到全屏显示这个部分区域是由鼠标进行框定的没有这个也无所谓只是多了个工具
      

  9.   

    请问Image类能否在VC6里面用?怎么用?
      

  10.   

    construct (graphic) 老弟,这几天整理了给你寄去,我的工作没人帮我啊,呵呵。
      

  11.   

    自己看msdn文档吧我正在忙着项目也没时间啊!
      

  12.   

    MFCSHWJ(MFC初学者)多谢你的程序挺好的!多谢你,分是少不了你的!:)
      

  13.   

    已经发给你了
    ,忙活了几个小时说明一下:
      1。 另存文件的ico, emf,wmf可能不管用,可能要增加代码来实现。目前没时间测试
      2。 缩放图像的时候图像闪烁2下,属正常现象,来不及更改,要想不闪烁,可以采用双缓冲
      3。 rubber zoom 因为时间关系没有作,打算明天完成再发给你
      4。据说有些老格式的tiff无法加载,属于GDI+的bug,跟我无关,^_^
      4。 可能有其他小错误来不及测试发现,请见谅。太忙时间太少。请通知我以便于改正。 老王
      

  14.   

    装个SDK吧!!!里面的SDK帮助对GDI+有详尽的说明!!!!
    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);
      

  15.   

    //抱歉很忙,原来是设定更改jpeg质量的,忘记删除了//鼠标拖动图像,即pan view,就是得到鼠标移动距离,再让滚动条移动位置就行了//GDIplusImageDoc.cpp 173行 的 &encoderParameters 改为NULL//即用默认的jpeg质量.更改如下: Status last =  m_pImage->Save(ToWChar   (strFileSave.GetBuffer(strFileSave.GetLength())),    &clsid, NULL);双缓存的实现跟一般GDI一样的