I originally come from VC6++ and are used with CDCs. This looks quite similar and helped me a lot!
Thanks
Pin
did u find how to copy the memeory bitmap use this method?
Anyone knows how i can load an image from file(or create and draw in memory) and then use with BitBlt(NOT .DrawImage)?
cause i can't make it work...
Fade (Amit BS)
The complete answer is here, in an article i wrote about BitBlt usage, has lots of info
[]
Fade (Amit BS)
In the cleanup section I had:
srcPic.Dispose()
srcMem.Dispose()
srcMem.Dispose()
You need to change it to this:
srcPic.Dispose()
srcBMP.Dispose()
srcMem.Dispose()
It creaated a huge memoty leak on my system.
It will be ok if you fix that. oops
Make sure you fix your code, then send the zipped source to submit@codeproject.com. You shouldn't put the burden on other people to fix your bugs.
Also, it'd be good to document this in a History section (like most other articles) to document what changed about your article or code. A lot of people don't check the message section for updates because the updates are usually reflected in the article and sample code.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
Have you compared the speed of a BitBlt to .Net's DrawImage method? I've been trying to find the time to do that. I was using DrawImage in an application and found it far too slow for doing any really serious graphics display. BitBlting in C++ was far faster, but I don't know if the speed issue has more to do with the inherent overhead of .Net or the DrawImage method itself.
Hardly faster when using the native GDI+ format (Format32bppPArgb). In that case I measure about 10 - 15% speed increase for the GDI BitBlt versus GDI+ DrawImage. Such a small gain is NOT worth digging into to GDI API for. Note that when using any other pixel format DrawImage becomes 2-3 times slower!!!!
Machine is a 1.7 GHz 512 MB Intel 850 Mobo running XP Pro SP2.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-31928-5.html
虽然美国一开始扶持了傀儡政权
北洋水师出击必须采取一字横阵向前冲