How to draw some bitmaps from memory to specific area of the screen and keep the rest area unchanged RRS feed

All replies

  • I find a way to do incremental  redrawing, but am not sure that is the most effective way.  

    The most important part of the incremental redrawing is using 'dirty rects'. 

    DXGI_PRESENT_PARAMETERS parameters = {0};

    parameters.DirtyRectsCount = 1; // 1 means one area to be updated.

    parameters.pDirectRects = &rc; // rc: rect of area to be updated.

    m_swapChain->Present1(1, 0 , &parameters);

    The above code will only redraw the specified area that defined in rc.

    (2) First create a bitmap form swapchain and set it as the target bitmap;

        then copy from memory every time that update comes.

         call above code to render the picture.

    I'm not sure whether this is the best solution but it works.  Please give your comments here .  



    Friday, May 31, 2013 9:03 AM