Does .Net use device-dependent or device-independent bitmaps?

When loading an image into memory, does .Net use DDB, DIB, or something else? If possible, cite sources.

I'm curious because we currently have a classic ASP application that uses a third-party component to load images that occasionally create "Not enough memory to process this command." error. The error is very incompatible, but tends to occur on large images (not always, but often). After resetting IIS, processing the same file again usually works very well.

After much research, I found that DDBs have this problem when processing large images because they work from video memory. Given that we work on a web server with an integrated graphics card and limited shared memory, this can certainly be our problem.

We are in the early stages of converting our application to .Net and are wondering if using .Net for this can be a viable alternative to our current method, so I ask a question.

Any advice is welcome :), but out of curiosity, if nothing else, I really hope to answer the question; uses .Net uses DDB or DIB?

+3
source share
2 answers

: , , pre-WPF.NET( ).

- "". System.Drawing Bitmap , DIB ( Bitmap). Bitmap GetHbitmap, DIB ( Device Dependent Bitmap) , .

DDB ( Super-fast BitBlt API). DDB .Net( , IMO). GetHbitmap - , DeleteObject , , , ( , , .Net PInvoked API). , IntPtr, , , , , , , .Net(DIB).

, :.Net DIB, DDB. , . - .NET, GetHbitmap DeleteObject, .

, : .Net, , ? - , , .NET . .NET , - , , , .

: MSDN:

System.Drawing Windows ASP.NET. , .

: ", , - , ". , - - . , , . , -, , .

, , , -, , , , - . , , -, .

1: ( ) .NET Compact Framework, , ( - , ):

[.NetCF] . , , , .

  • Bitmap, [.. ]
    • DIB
    • DIB (VM)
  • /
    • DDB
    • DDB , , gwes.exe , , . , VM .

, 2 . DDB, , DIB, , LockBits Save to be . DIB, , , , height pixelformat. DIB DDB.

( .NetCF) :

http://blog.opennetcf.com/ctacke/PermaLink,guid,987041fc-2e13-4bab-930a-f79021225b74.aspx

2: , .NET ( ):

http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-performance/1187/Graphics-FromImage-Process-memory-usage

http://www.netframeworkdev.com/common-language-runtime/memory-issues-with-systemdrawingbitmap-30879.shtml

http://www.west-wind.com/WebLog/posts/8230.aspx

http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.drawing/2005-06/msg00171.html

: , , ( , Bitmap), .NET, . , , , , , , MSDN, , ,

System.Drawing Windows ASP.NET. , .

+4

, System.Drawing , , , (, - , ).

Windows, , .Net Win32. Bertrand Le Roy , : ASP.NET. () -. WIC, -, , GDI +.

, WPF, , WIC, , WIC , , . : WPF/WIC GDI +

WIC, WPF , , , GDI +.

+1

Source: https://habr.com/ru/post/1744083/


All Articles