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

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

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

問題描述

我正在做一些大學(xué)項目,但遇到了內(nèi)存問題.我加載了一個位圖,它在硬盤上占用了大約 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); 

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

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# 只是為了提取所需的數(shù)組,稍后在 c++ 中處理 - 也許我可以在 c++ 中提取所有需要的數(shù)據(jù)(但這里出現(xiàn)轉(zhuǎn)換問題 - 我專注于 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:我需要將整個位圖保留在內(nèi)存中,因此將其拆分為多個部分不是解決方案.

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

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

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.

推薦答案

考慮使用內(nèi)存映射文件來訪問您的巨大數(shù)據(jù):).可以在此處找到專注于您需要的示例: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.

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

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

相關(guān)文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應(yīng)用程序中的列表框)
WPF c# webbrowser scrolls over top menu(WPF c# webbrowser 在頂部菜單上滾動)
C# Console app - How do I make an interactive menu?(C# 控制臺應(yīng)用程序 - 如何制作交互式菜單?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創(chuàng)建重復(fù)的表單?)
UI Automation Control Desktop Application and Click on Menu Strip(UI自動化控制桌面應(yīng)用程序并單擊菜單條)
Removing thin border around the menuitems(刪除菜單項周圍的細邊框)
主站蜘蛛池模板: 国产污视频在线 | 五月婷婷激情 | 黄在线免费观看 | 在线视频一区二区 | 色综合一区二区三区 | 91毛片网 | 四季久久免费一区二区三区四区 | 久久69精品久久久久久久电影好 | 97国产一区二区精品久久呦 | 伊人网站在线观看 | 国产日韩欧美在线观看 | 久久成人一区 | 成年人黄色一级毛片 | 国产一区在线免费 | 黄视频欧美| 免费在线一区二区三区 | 久久精品亚洲欧美日韩精品中文字幕 | 一区二区三区免费 | 久久机热| 精品国产乱码久久久久久果冻传媒 | 欧美一区二区三区在线观看视频 | 午夜丰满寂寞少妇精品 | 国产二区视频 | 免费国产一区 | 精品日韩一区二区 | 日韩成人在线网址 | 天天射美女 | a黄在线观看| 特级a欧美做爰片毛片 | 国产午夜精品福利 | 欧美视频网 | 在线一级片 | 亚洲国产精品99久久久久久久久 | 国产免费视频在线 | 日韩精品三区 | 久久成人高清视频 | 久久高潮| 91porn在线观看 | 午夜精品久久久久久久星辰影院 | 日韩a在线| 一区二区在线视频 |