<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                PPAPI Plugin在Windows下是DLL,可以嵌入圖片文件,使用Skia繪圖時需要根據DLL里的圖片文件生成SkBitmap對象。下面是代碼: ~~~ #include "utils.h" #include "SkStream.h" #include "SkImageDecoder.h" #include <tchar.h> SkBitmap* loadImageFromResource(UINT resId, LPCTSTR lpType) { TCHAR szLog[512] = { 0 }; HMODULE hModule = NULL; if (FALSE == GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS , (LPCTSTR)loadImageFromResource, &hModule)) { _stprintf_s(szLog, 512, _T("GetModuleHandleEx failed, error - %d\r\n"), GetLastError()); OutputDebugString(szLog); return NULL; } HRSRC hRsrc = FindResource(hModule, MAKEINTRESOURCE(resId), lpType); if (hRsrc == NULL) { _stprintf_s(szLog, 512, _T("FindResource failed, error - %d\r\n"), GetLastError()); OutputDebugString(szLog); return NULL; } HGLOBAL hImgData = LoadResource(hModule, hRsrc); if (hImgData == NULL) { _stprintf_s(szLog, 512, _T("LoadResource failed, error - %d\r\n"), GetLastError()); OutputDebugString(szLog); return NULL; } LPVOID lpData = LockResource(hImgData); if (lpData == NULL) { _stprintf_s(szLog, 512, _T("LockResource failed, error - %d\r\n"), GetLastError()); OutputDebugString(szLog); return NULL; } DWORD dwSize = SizeofResource(hModule, hRsrc); SkMemoryStream memoryStream(lpData, dwSize); SkImageDecoder *decoder = SkImageDecoder::Factory(&memoryStream); if (!decoder) { OutputDebugString(_T("SkImageDecoder::Factory failed\r\n")); FreeResource(hImgData); return NULL; } SkBitmap *bitmap = new SkBitmap(); if (SkImageDecoder::kSuccess == decoder->decode(&memoryStream, bitmap, kBGRA_8888_SkColorType, SkImageDecoder::kDecodePixels_Mode)) { FreeResource(hImgData); return bitmap; } //error OutputDebugString(_T("SkImageDecoder::decode failed\r\n")); FreeResource(hImgData); delete bitmap; return NULL; } ~~~ 使用非常簡單: ~~~ SkBitmap *bitmap = loadImageFromResource(IDB_CLEAR, _T("PNG")); ~~~ 注意我添加的是png文件,rc文件內有類似這樣的語句: ~~~ IDB_CLEAR PNG "images\\icon-clear.png" ~~~ 其中第二列是資源類型,調用loadImageFromResource時指定的類型與這里一致即可。 其他參考文章: - [**CEF Windows開發環境搭建**](http://blog.csdn.net/foruok/article/details/50468642) - [**CEF加載PPAPI插件**](http://blog.csdn.net/foruok/article/details/50485448) - [**VS2013編譯最簡單的PPAPI插件**](http://blog.csdn.net/foruok/article/details/50485461) - [**理解PPAPI的設計**](http://blog.csdn.net/foruok/article/details/50486788) - [**PPAPI插件與瀏覽器的交互過程**](http://blog.csdn.net/foruok/article/details/50494061) - [**Windows下從源碼編譯CEF**](http://blog.csdn.net/foruok/article/details/50498740) - [**編譯PPAPI的media_stream_video示例**](http://blog.csdn.net/foruok/article/details/50498873) - [**PPAPI插件的繪圖與輸入事件處理**](http://blog.csdn.net/foruok/article/details/50499813) - [**在PPAPI插件中創建本地窗口**](http://blog.csdn.net/foruok/article/details/50513228) - [**PPAPI插件與瀏覽器的通信**](http://blog.csdn.net/foruok/article/details/50513315) - [**Windows下從源碼編譯Skia**](http://blog.csdn.net/foruok/article/details/50524726) - [**在PPAPI插件中使用Skia繪圖**](http://blog.csdn.net/foruok/article/details/50526110)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看