Where ptrS and ptrD are pointers to the top left pixels of a source bitmap and a destination bitmap (both images have been locked using LockBits).
When I run the pointer version, I get a NullReferenceException, which probably means my pointers are running wild and free on the open plains of my RAM.
The code that I am trying to replace works just fine, I can't work out why my pointer math won't work. Is it a bracket in the wrong place or something????
So how much of a framerate increase can I take credit for?
Actually I changed a lot to make it all understandable to me, and tinkered it to a point were it is working so I'm not really sure where your fault lies. You'll see.
Last edited by grilkip; Dec 16th, 2007 at 11:29 AM.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
Could eliminating some of the conversions within the loop make a difference?
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
wont help you at all, but in case someone else wants to use it
this just shows how to read and copy every pixel to a destination bitmap.
I just tested it with bitmaps of the same size. Also change "3" to "4" if you're using 32bit pixel format....
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Woo000t!!! It works!! I got my code going at last.
I'll post the code then I'm happy that its as fast as its going to get (i still need to add coordinate safety checks to make sure we don't try to use pointers outside the bitmap area)...
The number on the titlebar is FRAMES PER SECOND!!! (ok its still not as fast as GDI+ but its not bending the texture either!)