PC Review


Reply
Thread Tools Rate Thread

Bitmap.SetPixel

 
 
Atmapuri
Guest
Posts: n/a
 
      5th Sep 2006
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


 
Reply With Quote
 
 
 
 
Marc Gravell
Guest
Posts: n/a
 
      5th Sep 2006
Yes; LockBits; see http://www.bobpowell.net/lockingbits.htm

Marc


 
Reply With Quote
 
Morten Wennevik
Guest
Posts: n/a
 
      5th Sep 2006
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 <(E-Mail Removed)> wrote:

> 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]
 
Reply With Quote
 
Atmapuri
Guest
Posts: n/a
 
      5th Sep 2006
Hi!

Thanks to both of you
Atmapuri

"Morten Wennevik" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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 <(E-Mail Removed)> wrote:
>
>> 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]



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ArgumentException: Invalid parameter used at Bitmap.SetPixel halise Microsoft C# .NET 3 8th Mar 2005 12:02 PM
[BugReport] Bitmap.SetPixel() Lloyd Dupont Microsoft Dot NET Compact Framework 2 15th Jan 2004 06:29 AM
[BugReport] Bitmap.SetPixel() Lloyd Dupont Microsoft Dot NET Compact Framework 4 15th Jan 2004 12:22 AM
Bitmap.SetPixel() Lloyd Dupont Microsoft Dot NET Compact Framework 0 13th Jan 2004 11:12 PM
Safe fast alternative to Bitmap.SetPixel Lord Crc Microsoft Dot NET Framework 0 4th Jan 2004 11:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 AM.