各位编程的高手们,我最近在开发程序的过程中遇到一个问题,就是不知道如何在DOS的环境中,实现图像间的相互转换,例如:如果将一个.bmp互换成.jpeg或.gif等等,烦请帮忙,急切解决,在线等!!或可以直接联系[email protected]

解决方案 »

  1.   

    读取文件,转化,保存阿
    和windows没什么区别吧,就是没有些现成函数,如LoadImage,GetBitmapBits
    或者用类库,但肯定比较少
      

  2.   

    可以用atl来实现
    atl中有一个叫CImage的类
    具体使用如下
    CImage Image;
    Image.Load(LPCTSTR lpszFileName);//根据lpszFileName 中扩展名不同,自动保存为
    相应格式,保存bmp则MyBmp.bmp要保存为jpeg则MyJpeg.jpg目前CImage支持.bmp;.jpeg
    .gif;.png;.tif等格式
    Image.Save(LPCTSTR lpszFileName);
    Image.Attach(HBITMAP hBitmap);//把一个位图写入Image
    Image.Detach();//返回一个从Image分离出来的位图
    HBITMAP hBitmap = (HBITMAP)Image;//得到Image中的位图
    有了以上的CImage的方法和运算符,就可以实现不同图象格式的转化了
      

  3.   

    also seehttp://www.paintlib.de/paintlib/"..
    paintlib is a portable C class library for image loading, saving and manipulation. Images can be loaded from BMP, GIF, JPEG, PCX, PGM, PICT, PNG, PSD, TGA, TIFF and WMF files and saved in BMP, JPEG, PNG and TIFF formats. Image manipulation can be done either through filters implemented in filter classes or by directly accessing the bitmap bits. Full C source is provided.
    ..."