On Fri, 12 Jan 2007 07:09:44 +0100, "Bob Powell [MVP]"
<bob@_spamkiller_bobpowell.netwrote:
>The two principles are totally different.
BitBlit and incidentally DrawImage is for copying an image in memory to
the graphics object. Either a graphics device such as a screen or a
second in-memory graphics object.
LockBits enables direct access to the image byte array without the need
to go through the less efficient bitmap image APIs. Access in this way
is fast and unsubtle.
I didn't explain the intent very well. A closer analogy would have
been 'DibSection + BitBlt' vs 'LockBits + DrawImageUnscaled.'
I'm thinking about revisiting an app that I worked on ages ago in olde
C++ (seems way too long ago).
>Where LockBits even approaches the philosophy of BitBlit is when a
direct image to image copy operation is needed. In this case LockBits
may be used to access both memory buffers and data transferred from one
to the other.
That's about it. The app basically builds a screen behind the scenes
by stamping graphics images into ram, cookie-cutter style. Envision
something like an schematic cad system with preset resistor and
capacitor symbols in monochrome bit patterns. Not an animation, per
se, but I need to do a complete BitBlt on a large window.
If memory serves, I was using DibSections and/or a 'magic'
undocumented ROP, 0xE20746, which does the cookie cutter thing quite
efficiently (Not sure why that was not documented).
In the interim, I've written some C# code where I had to do something
vaguely like that. I ended up using Lockbits to access ram and stamp
the pattern, then DrawImageUnscaled() to blt it.
I've heard that to get sufficient speed that C# programmers are still
Interop'ing older Dibsection/BitBlt calls. Can LockBits get close to
that speed? Maybe I should just be thinking DirectX, but this is
almost like a schematic cad program, not a game.
[re Lockbits]
Any form of clever image processing in this transfer
begins to approach the inefficiency of DrawImage if any processing is
done on the image data.
You got me there. I thought that would be the fast part.