久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='pquRN'></tfoot>
<i id='pquRN'><tr id='pquRN'><dt id='pquRN'><q id='pquRN'><span id='pquRN'><b id='pquRN'><form id='pquRN'><ins id='pquRN'></ins><ul id='pquRN'></ul><sub id='pquRN'></sub></form><legend id='pquRN'></legend><bdo id='pquRN'><pre id='pquRN'><center id='pquRN'></center></pre></bdo></b><th id='pquRN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='pquRN'><tfoot id='pquRN'></tfoot><dl id='pquRN'><fieldset id='pquRN'></fieldset></dl></div>
  • <legend id='pquRN'><style id='pquRN'><dir id='pquRN'><q id='pquRN'></q></dir></style></legend>
    • <bdo id='pquRN'></bdo><ul id='pquRN'></ul>
    1. <small id='pquRN'></small><noframes id='pquRN'>

        GDI+ 是否具有標(biāo)準(zhǔn)圖像編碼器 CLSID?

        Does GDI+ have standard image encoder CLSIDs?(GDI+ 是否具有標(biāo)準(zhǔn)圖像編碼器 CLSID?)
            <tfoot id='iRlTV'></tfoot>

            <small id='iRlTV'></small><noframes id='iRlTV'>

              • <bdo id='iRlTV'></bdo><ul id='iRlTV'></ul>
                • <legend id='iRlTV'><style id='iRlTV'><dir id='iRlTV'><q id='iRlTV'></q></dir></style></legend>

                    <tbody id='iRlTV'></tbody>

                  <i id='iRlTV'><tr id='iRlTV'><dt id='iRlTV'><q id='iRlTV'><span id='iRlTV'><b id='iRlTV'><form id='iRlTV'><ins id='iRlTV'></ins><ul id='iRlTV'></ul><sub id='iRlTV'></sub></form><legend id='iRlTV'></legend><bdo id='iRlTV'><pre id='iRlTV'><center id='iRlTV'></center></pre></bdo></b><th id='iRlTV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iRlTV'><tfoot id='iRlTV'></tfoot><dl id='iRlTV'><fieldset id='iRlTV'></fieldset></dl></div>
                  本文介紹了GDI+ 是否具有標(biāo)準(zhǔn)圖像編碼器 CLSID?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  GDI+ Image::Save 方法需要一個(gè) CLSID 參數(shù)來(lái)指定要使用的編碼器.該文檔指向一些示例代碼獲取與特定 MIME 類型關(guān)聯(lián)的編碼器,例如 image/jpeg 或 image/png.然而,我對(duì)復(fù)制半頁(yè)函數(shù)只是為了支持 1 行調(diào)試幫助而猶豫不決,我將中間結(jié)果保存到磁盤(pán).

                  The GDI+ Image::Save method requires a CLSID parameter to specify the encoder to use. The documentation points to some sample code for getting the encoder associated with a particular MIME type, such as image/jpeg or image/png. However I'm balking at the thought of copying a half-page function just to support a 1-line debugging aid where I save an intermediate result out to disk.

                  不應(yīng)該有標(biāo)準(zhǔn)編碼器的標(biāo)準(zhǔn) CLSID 列表嗎?我在哪里可以找到這樣的列表?我一直無(wú)法通過(guò)搜索 Microsoft 的包含文件找到一個(gè).

                  Shouldn't there be a list of standard CLSIDs for the standard encoders? Where would I find such a list? I haven't been able to find one by searching Microsoft's include files.

                  推薦答案

                  沒(méi)有.我認(rèn)為他們希望編解碼器列表可擴(kuò)展并支持插件,但從未考慮過(guò)它.鑒于他們?cè)谙喈?dāng)長(zhǎng)的一段時(shí)間內(nèi)沒(méi)有對(duì) GDI+ 進(jìn)行任何更改,因此他們可能不會(huì)很快做出更改.您可能可以根據(jù) Gdiplus::GetImageEncoders 的枚舉生成自己的硬編碼列表.

                  There isn't one. I think they intended the codec list to be extensible and support plugins, but never got around to it. Given that they haven't made any changes to GDI+ in quite some time, they likely won't anytime soon. You could probably get away with generating your own hard coded list based on an enumeration of Gdiplus::GetImageEncoders.

                  即:

                  image/bmp  : {557cf400-1a04-11d3-9a73-0000f81ef32e}
                  image/jpeg : {557cf401-1a04-11d3-9a73-0000f81ef32e} 
                  image/gif  : {557cf402-1a04-11d3-9a73-0000f81ef32e} 
                  image/tiff : {557cf405-1a04-11d3-9a73-0000f81ef32e}
                  image/png  : {557cf406-1a04-11d3-9a73-0000f81ef32e}
                  

                  這是我經(jīng)常在項(xiàng)目之間剪切和粘貼的函數(shù),用于獲取編碼器的 CLSID.您可以將其修改為表查找.

                  Here's the function I routinely cut&paste between projects for getting at the CLSID of the encoder. You could modify it to be a table lookup.

                  #include <windows.h>
                  #include <gdiplus.h>
                  #include <string>
                  #include <vector>
                  
                  HRESULT GetGdiplusEncoderClsid(const std::wstring& format, GUID* pGuid)
                  {
                      HRESULT hr = S_OK;
                      UINT  nEncoders = 0;          // number of image encoders
                      UINT  nSize = 0;              // size of the image encoder array in bytes
                      std::vector<BYTE> spData;
                      Gdiplus::ImageCodecInfo* pImageCodecInfo = NULL;
                      Gdiplus::Status status;
                      bool found = false;
                  
                      if (format.empty() || !pGuid)
                      {
                          hr = E_INVALIDARG;
                      }
                  
                      if (SUCCEEDED(hr))
                      {
                          *pGuid = GUID_NULL;
                          status = Gdiplus::GetImageEncodersSize(&nEncoders, &nSize);
                  
                          if ((status != Gdiplus::Ok) || (nSize == 0))
                          {
                              hr = E_FAIL;
                          }
                      }
                  
                      if (SUCCEEDED(hr))
                      {
                  
                          spData.resize(nSize);
                          pImageCodecInfo = (Gdiplus::ImageCodecInfo*)&spData.front();
                          status = Gdiplus::GetImageEncoders(nEncoders, nSize, pImageCodecInfo);
                  
                          if (status != Gdiplus::Ok)
                          {
                              hr = E_FAIL;
                          }
                      }
                  
                      if (SUCCEEDED(hr))
                      {
                          for (UINT j = 0; j < nEncoders && !found; j++)
                          {
                              if (pImageCodecInfo[j].MimeType == format)
                              {
                                  *pGuid = pImageCodecInfo[j].Clsid;
                                  found = true;
                              }
                          }
                  
                          hr = found ? S_OK : E_FAIL;
                      }
                  
                      return hr;
                  }
                  
                  
                  int main()
                  {
                      Gdiplus::GdiplusStartupInput gdiplusStartupInput;
                      ULONG_PTR gdiplusToken;
                      GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
                  
                      GUID guidBmp = {};
                      GUID guidJpeg = {};
                      GUID guidGif = {};
                      GUID guidTiff = {};
                      GUID guidPng = {};
                  
                      GetGdiplusEncoderClsid(L"image/bmp", &guidBmp);
                      GetGdiplusEncoderClsid(L"image/jpeg", &guidJpeg);
                      GetGdiplusEncoderClsid(L"image/gif", &guidGif);
                      GetGdiplusEncoderClsid(L"image/tiff", &guidTiff);
                      GetGdiplusEncoderClsid(L"image/png", &guidPng);
                  
                      return 0;
                  }
                  

                  這篇關(guān)于GDI+ 是否具有標(biāo)準(zhǔn)圖像編碼器 CLSID?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當(dāng)沒(méi)有異常時(shí),C++ 異常會(huì)以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對(duì) const 的引用?)
                  When and how should I use exception handling?(我應(yīng)該何時(shí)以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對(duì)象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構(gòu)造函數(shù)的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說(shuō)明符 C++11 noexcept 之間的區(qū)別)
                    <tbody id='8nEpk'></tbody>
                  <legend id='8nEpk'><style id='8nEpk'><dir id='8nEpk'><q id='8nEpk'></q></dir></style></legend>

                  1. <i id='8nEpk'><tr id='8nEpk'><dt id='8nEpk'><q id='8nEpk'><span id='8nEpk'><b id='8nEpk'><form id='8nEpk'><ins id='8nEpk'></ins><ul id='8nEpk'></ul><sub id='8nEpk'></sub></form><legend id='8nEpk'></legend><bdo id='8nEpk'><pre id='8nEpk'><center id='8nEpk'></center></pre></bdo></b><th id='8nEpk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8nEpk'><tfoot id='8nEpk'></tfoot><dl id='8nEpk'><fieldset id='8nEpk'></fieldset></dl></div>
                    <tfoot id='8nEpk'></tfoot>

                    • <bdo id='8nEpk'></bdo><ul id='8nEpk'></ul>

                            <small id='8nEpk'></small><noframes id='8nEpk'>

                            主站蜘蛛池模板: 91玖玖 | 亚洲精品毛片av | 精产国产伦理一二三区 | 久久久久国产精品www | 激情欧美一区二区三区中文字幕 | 日韩在线精品强乱中文字幕 | 91在线观看视频 | 国产精品久久久久久久毛片 | 成人免费一级视频 | 欧美一区二区三区久久精品 | 久久久久久国产精品久久 | 亚洲最新在线视频 | 国产精品1区2区3区 男女啪啪高潮无遮挡免费动态 | 日韩欧美在线一区 | 91午夜在线 | 一区二区精品 | av电影一区 | 久久久性| 亚洲精品9999久久久久 | 美国黄色毛片 | 国产成人免费在线 | 激情六月丁香婷婷 | 全部免费毛片在线播放网站 | 99精品欧美一区二区三区 | 久久精品国产一区 | 亚洲精品一区二区三区四区高清 | 视频在线一区二区 | 亚洲欧美一区二区三区视频 | 久久久免费观看视频 | 七七婷婷婷婷精品国产 | 国产人免费人成免费视频 | 一区二区三区在线 | 欧美精品在线播放 | www.国产精品| 91国产精品| 国产一区亚洲 | 精品国产色 | 草草影院ccyy | 国产精品久久久久久久模特 | 国产精品国产三级国产aⅴ原创 | 四色永久 |