开发者

what's the difference between GdipBitmapLockBits and CreateDIBSection

GdipBitmapLockBits works on pBitmaps, requires locking ?

CreatDIBSection gives you a DIBsection, doesn't require locking ?

which method开发者_JAVA百科 is better for working with raw pixel data ?

Here are two implementations for finding the difference between two images using each method.


These pieces, by themselves, aren't enough different to care much about. Mostly it comes down to a question of whether the rest of your code is using GDI or GDI+. If you're using GDI+, you might as well use gdipBitmapLockBits. If the rest of your drawing code just uses GDI, then you might as well use CreateDIBSection.


I won't expect any difference. The "lock" is just there to avoid the access violation you'd get when you close the memory mapped file and use the pointer to the bitmap data afterward.

The real cost is going to be in the code you run that whacks the bitmap bits.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜