469,628 Members | 1,130 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

Bitmap.SetPixel

Hi!

I was profiling a drawing applicationa and Bitmap.SetPixel
is consuming 90% of all CPU. Is there an alternative way
to create the bitmap and fill it with data that is stored
in an array of doubles?

Thanks!
Atmapuri
Sep 5 '06 #1
3 7654
Yes; LockBits; see http://www.bobpowell.net/lockingbits.htm

Marc
Sep 5 '06 #2
Hi Atmapuri,

Yes, you can write directly using LockBits and unsafe code blocks.
See Bob Powells GDI+ Faq for a description on how to do this.

http://www.bobpowell.net/lockingbits.htm
On Tue, 05 Sep 2006 12:25:31 +0200, Atmapuri <di*@community.nospamwrote:
Hi!

I was profiling a drawing applicationa and Bitmap.SetPixel
is consuming 90% of all CPU. Is there an alternative way
to create the bitmap and fill it with data that is stored
in an array of doubles?

Thanks!
Atmapuri



--
Happy Coding!
Morten Wennevik [C# MVP]
Sep 5 '06 #3
Hi!

Thanks to both of you :)
Atmapuri

"Morten Wennevik" <Mo************@hotmail.comwrote in message
news:op***************@tr024.bouvet.no...
Hi Atmapuri,

Yes, you can write directly using LockBits and unsafe code blocks.
See Bob Powells GDI+ Faq for a description on how to do this.

http://www.bobpowell.net/lockingbits.htm
On Tue, 05 Sep 2006 12:25:31 +0200, Atmapuri <di*@community.nospamwrote:
>Hi!

I was profiling a drawing applicationa and Bitmap.SetPixel
is consuming 90% of all CPU. Is there an alternative way
to create the bitmap and fill it with data that is stored
in an array of doubles?

Thanks!
Atmapuri


--
Happy Coding!
Morten Wennevik [C# MVP]

Sep 5 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jeroen Ceuppens | last post: by
1 post views Thread by James Dean | last post: by
3 posts views Thread by Samuel | last post: by
2 posts views Thread by Peter Oliphant | last post: by
2 posts views Thread by Steve Richter | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.