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

處理大型位圖(最大 3GB)

Processing on large bitmaps (up to 3GB)(處理大型位圖(最大 3GB))
本文介紹了處理大型位圖(最大 3GB)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在做一些大學項目,但遇到了內存問題.我加載了一個位圖,它在硬盤上占用了大約 1.5GB 的空間,代碼如下:

I'm working on some university project and got stuck with memory issue. I load a bitmap which takes about 1,5GB on HDD with code below:

Bitmap bmp = new Bitmap(pathToFile); 

問題是新創建的 Bitmap 對象使用了大約 3.5GB 的 RAM,這是我無法理解的(這真是大包裝:E).我需要訪問像素數組,Bitmap 類的使用真的很有幫助(我稍后使用 LockBits() 方法,并處理每個字節的數組字節)但在這種情況下它完全是阻塞器.所以這是我的問題:

The issue is that the newly created Bitmap object uses about 3,5GB of RAM which is something I can't understand (that's really BIG wrapper :E). I need to get to the pixel array, and the use of Bitmap class is really helpful (I use LockBits() method later, and process the array byte per byte) but in this case it's total blocker. So here is my question:

有沒有什么簡單的方法可以在不借出額外 2gb 的情況下提取像素陣列?

Is there any easy way to extract the pixel array without lending additional 2gb?

我使用 c# 只是為了提取所需的數組,稍后在 c++ 中處理 - 也許我可以在 c++ 中提取所有需要的數據(但這里出現轉換問題 - 我專注于 24bgr 格式)?

I'm using c# just to extract the needed array, which is later processed in c++ - maybe I can extract all needed data in c++ (but conversion issue appears here - I'm concentrating on 24bgr format)?

PS:我需要將整個位圖保留在內存中,因此將其拆分為多個部分不是解決方案.

PS: I need to keep the whole bitmap in memory so splitting it into parts is no solution.

PS2:只是澄清一些問題:我知道文件擴展名和文件格式之間的區別.加載的文件是未壓縮的位圖,每像素 3 個字節,大小為 ~1.42GB(16k x 32k 像素),那么為什么 Bitmap 對象要大兩倍以上?沒有發生任何解壓問題和轉換為其他格式的問題.

PS2: Just to clarify some issues: I know the difference between file extension and file format. The loaded file is uncompressed bitmap 3 bytes per pixel of size ~1.42GB (16k x 32k pixels), so why Bitmap object is more than two times bigger? Any decompressing issues and converting into other format aren't taking place.

推薦答案

考慮使用內存映射文件來訪問您的巨大數據:).可以在此處找到專注于您需要的示例:http:///visualstudiomagazine.com/articles/2010/06/23/memory-mapped-files.aspx它在托管代碼中,但您也可以從等效的本機代碼中使用它.

Consider using Memory Mapped Files to access your HUGE data :). An example focused on what you need can be found here: http://visualstudiomagazine.com/articles/2010/06/23/memory-mapped-files.aspx It's in managed code but you might as well use it from equivalent native code.

如果您需要更多詳細信息,請告訴我.

Let me know if you need more details.

這篇關于處理大型位圖(最大 3GB)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應用程序中的列表框)
WPF c# webbrowser scrolls over top menu(WPF c# webbrowser 在頂部菜單上滾動)
C# Console app - How do I make an interactive menu?(C# 控制臺應用程序 - 如何制作交互式菜單?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創建重復的表單?)
UI Automation Control Desktop Application and Click on Menu Strip(UI自動化控制桌面應用程序并單擊菜單條)
Removing thin border around the menuitems(刪除菜單項周圍的細邊框)
主站蜘蛛池模板: a在线视频 | 国产精品国产三级国产专区53 | 亚洲成人欧美 | 亚洲欧美日韩国产精品 | 免费三级网站 | 天天干天天操天天插 | 亚洲午夜在线观看 | 日本国产视频 | 黄色网在线 | 国产色站 | 欧洲色综合 | 国产一区二区三区久久 | 亚洲一区中文 | 亚洲欧美精品一区二区 | 日韩小视频在线观看 | 91亚洲国产 | 五月天婷婷激情网 | 一区二区视频网站 | 黄色片免费网站 | 成人黄色免费视频 | 久久狠狠干 | 狠狠操综合网 | 麻豆一区二区三区 | 激情视频小说 | 国产三级黄色 | 欧美色影院 | 91久久精品日日躁夜夜躁欧美 | 日韩欧美中文在线 | 国产一区在线播放 | 女人高潮特级毛片 | 波多野吉衣一二三区乱码 | 狠狠做深爱婷婷久久综合一区 | 国产精品羞羞答答 | 欧美激情久久久 | 三级视频在线播放 | 成人做受黄大片 | 在线日韩欧美 | 在线免费成人 | 91午夜精品亚洲一区二区三区 | 久久久久国产精品夜夜夜夜夜 | 成人免费网址 |