跪谢!不要有使用限制的。谢谢

解决方案 »

  1.   

    JepgLib
    it's contained in CxImage
      

  2.   

    我VC不是很熟悉,所以希望有个dll或者ocx可以直接调用。不需要复杂的功能,只需要BMP->JPG或者能互转的最好。谢谢
      

  3.   

    #include <Gdiplus.h>
    using namespace Gdiplus;
    #pragma comment(lib, "GdiPlus.lib")void BMP2JPG(CString strBMPFile,CString strJPGFile)
    {
        CLSID  encoderClsid;
        WCHAR  strGuid[39];
        if(GetEncoderClsid(L"image/jpeg", &encoderClsid) >= 0)
        StringFromGUID2(encoderClsid, strGuid, 39);
     
        Image image(strBMPFile.AllocSysString());
        image.Save(strJPGFile.AllocSysString(),&encoderClsid,NULL);}int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
    {
       UINT  num = 0;          // number of image encoders
       UINT  size = 0;         // size of the image encoder array in bytes   GdiplusStartupInput gdiplusStartupInput;
       ULONG_PTR           gdiplusToken;
       GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); 
       
       ImageCodecInfo* pImageCodecInfo = NULL;   GetImageEncodersSize(&num, &size);
       if(size == 0)
          return -1;  // Failure   pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
       if(pImageCodecInfo == NULL)
          return -1;  // Failure   GetImageEncoders(num, size, pImageCodecInfo);   for(UINT j = 0; j < num; ++j)
       {
          if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 )
          {
             *pClsid = pImageCodecInfo[j].Clsid;
             free(pImageCodecInfo);
             return j;  // Success
          }    
       }   free(pImageCodecInfo);
       return -1;  // Failure
    }
      

  4.   

    大哥们! 我需要的是dll或者OCX ! 我用的不是VC 给我代码也没用啊
      

  5.   

    GdiPlus.dll不就是你要的吗?后面代码其实只是给你参考vc下是怎么用的。
      

  6.   

    网上例子例子贼多,去找找.
    用一个FLIB很不错,支持多种图像的转换及特效处理
      

  7.   

    GdiPlus.dll 不会用 网上说这个的是贼多但是能用的贼少另外,jpeg格式是公开的,为了这个要10块饭钱是不是有点不厚道有没有现成的 调用一个函数 输入的是bmp和质量,输出直接是jpg 的dll或者ocx?
      

  8.   

    hoho 用GdiPlus.dll搞定了。只不过质量到99的时候压缩率还是不高。1.06M的BMP压缩后108k 用画图另存为jpg只有40k郁闷 不过总算是能用了谢谢