Control.DrawToBitmap and Performances

Hi all,

I'm currently thinking on using quite intensivelly the DrawToBitmap method found in the Control class to render controls in certain places of my form.

I was wondering if any of you would have any idea of how it could affect performance

Thanks,

Amadrias


Answer this question

Control.DrawToBitmap and Performances

  • Martin Moe

    No, Basically, what I'm trying to achieve is make use of some old source code I do have to paint on Non Client areas.

    I have a control that perfectly paints what I want to achieve for this other control non client area but, as you know, you can't place a control out of the client rectangle and have it drawn still. So, I'm trying to achieve the same goal by copying the control as it renders into a bitmap that I use when the non client area is to be paint by using some Windows Messages I intercept in the WndProc.

    My only concern was if this repeated DrawToBitmap method wouldn't seriously affect performances if I have multiple of them versus making direct painting using a Graphics instance...

  • Julianín

    Umm, a control is not just a picture, it is also an object in the user's code with event handlers and what not. Are you trying to speed up a control's Paint event or something


  • Kjetil Tveit

    Thanks for this reply. I think I should make some benchmarks then as well as looking over the web on WM_PRINT intensive usage on GUI projects.

  • Haplo_69

    I don't think there is a performance issue in using DrawToBitmap method repeatedly, since all the method does is send a WM_PRINT message to the control to print itself to a device context, and bitblt it to a graphics object.

    Regards,

    -chris

  • Control.DrawToBitmap and Performances