locked
Why is Bitmap.SetPixel too slow? RRS feed

  • Question

  • Computer screen is always being redrawn and it makes no problem.

    So, why is Bitmap.SetPixel too slow?

    Is there a way to make as fast as computer redraws screen?

    Wednesday, December 10, 2014 8:46 AM

Answers

  • I found solution, use value types, pointers, unsafe code to increase performance.

    I have my code that works many times better than Set.Pixel method, but i would not share the code.


    • Edited by Ziya Ceferov Thursday, December 11, 2014 1:46 PM
    • Marked as answer by Ziya Ceferov Thursday, December 11, 2014 1:46 PM
    Thursday, December 11, 2014 1:46 PM

All replies

  • what do you mean ? the time for implementing this method is less than one milliseconds
    Wednesday, December 10, 2014 10:07 AM
  • refer to:
    C# Image Processing Performance - Unsafe vs. Safe code, Part I
    C# Image Processing Performance - Unsafe vs. Safe code, Part II
    SetPixel is too slow. Is there a faster way to draw to bitmap?

    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。


    • Edited by Bill ChungMVP Wednesday, December 10, 2014 10:27 AM
    • Proposed as answer by Risa- Thursday, December 11, 2014 1:51 AM
    • Unproposed as answer by Ziya Ceferov Thursday, December 11, 2014 5:15 PM
    Wednesday, December 10, 2014 10:25 AM
  • I found solution, use value types, pointers, unsafe code to increase performance.

    I have my code that works many times better than Set.Pixel method, but i would not share the code.


    • Edited by Ziya Ceferov Thursday, December 11, 2014 1:46 PM
    • Marked as answer by Ziya Ceferov Thursday, December 11, 2014 1:46 PM
    Thursday, December 11, 2014 1:46 PM
  • If anyone need access  gdi+ by unsafe code. Please cick here: Unsafe GDI+ Search.

    There are over hundreds post which talking about this topic.


    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Thursday, December 11, 2014 3:44 PM