3
A
回答
1
你可以試試DevIL Image Library我只使用它與OpenGL相關的東西,但它也只是一個普通的圖像加載庫。
1
查看wxWidgets GUI Framework中wxImage的源代碼。你很可能會對* nix發行版感興趣。
另一種選擇是GNU Jpeg庫。
2
ImageMagick庫也可以做到這一點,雖然它經常提供足夠的圖像處理函數,您可以做很多事情,而無需將圖像轉換爲字節數組並自行處理。
+0
從簡介:「僅向精靈級程序員推薦」o_O – DerMike 2011-09-14 12:12:47
+1
@DerMike:這只是爲了讓初學者對自己感覺更好,實在不那麼難:-) – Malvineous 2011-09-16 02:33:07
0
0
0
這是我將如何使用GDIPlus在頭GdiPlusBitmap.h定義Bitmap.LockBits方法做到這一點:
Gdiplus::BitmapData bitmapData;
Gdiplus::Rect rect(0, 0, bitmap.GetWidth(), bitmap.GetHeight());
//get the bitmap data
if(Gdiplus::Ok == bitmap.LockBits(
&rect, //A rectangle structure that specifies the portion of the Bitmap to lock.
Gdiplus::ImageLockModeRead | Gdiplus::ImageLockModeWrite, //ImageLockMode values that specifies the access level (read/write) for the Bitmap.
bitmap.GetPixelFormat(),// PixelFormat values that specifies the data format of the Bitmap.
&bitmapData //BitmapData that will contain the information about the lock operation.
))
{
//get the lenght of the bitmap data in bytes
int len = bitmapData.Height * std::abs(bitmapData.Stride);
BYTE* buffer = new BYTE[len];
memcpy(bitmapData.Scan0, buffer, len);//copy it to an array of BYTEs
//...
//cleanup
pBitmapImageRot.UnlockBits(&bitmapData);
delete []buffer;
}
相關問題
- 1. 將圖像轉換爲字節數組?
- 2. 將字節數組轉換爲圖像
- 3. 將字節數組轉換爲圖像
- 4. 使用c將字節轉換爲圖像&圖像到字節#
- 5. 如何將圖像轉換爲字節數組並將字節數組轉換爲圖像
- 6. 在打字稿中將圖像轉換爲字節數組
- 7. 將C#字節數組轉換爲C++
- 8. 如何將UIImagePicker圖像轉換爲字節數組objective-c
- 9. Android OutOfMemory將圖像字節數組轉換爲可繪製
- 10. 如何在J2ME中將圖像轉換爲字節數組?
- 11. 在Xamarin.Forms中將圖像轉換爲字節數組
- 12. jhipster - 在angularjs中將字節數組轉換爲圖像
- 13. 在java中將字節數組轉換爲圖像(blob)
- 14. 在Xamarin表單中將字節[]數組轉換爲圖像
- 15. 在PHP中將二進制字節數組轉換爲圖像
- 16. 將C#字節數組轉換爲VB.NET
- 17. C:將字節數組轉換爲struct
- 18. 在C#中將位圖轉換爲二維字節數組?
- 19. 將圖像數據轉換爲字節[]
- 20. 用於將圖像轉換爲字節數組的Python腳本
- 21. 將圖像轉換爲android中的字節數組
- 22. 如何將字節數組轉換爲java中的圖像?
- 23. 將圖像轉換爲Java中的字節數組
- 24. 將圖像轉換爲Java類中的字節數組
- 25. 將NSData轉換爲base64encoded並將字節數組轉換爲C#
- 26. 將字節數組轉換爲視圖上的圖像
- 27. 將位圖轉換爲字節數組
- 28. 將YUV攝像頭圖像轉換爲java字節數組
- 29. 使用Rails將字節數組轉換爲HTML圖像?
- 30. 如何將struct數組轉換爲c#中的字節數組?
什麼樣的字節陣列?像素顏色的字節數組? – glebm 2010-04-06 00:07:14
有什麼意義?一個圖像只在某個地方繪製像素時纔有意思。字節很無聊。如果必須使用FileStream + byte [(int)fs.Length]。 – 2010-04-06 00:18:08