How to judge the size of a bitmap that created by CreateBitmapFromDxgiSurface?


  • RECT drawingBounds;
    ComPtr<IDXGISurface> dxgiSurface;
    POINT surfaceOffset = {0};
    // ...
    m_vsisNative->BeginDraw(drawingBounds, &dxgiSurface, &surfaceOffset);
    ComPtr<ID2D1DeviceContext> d2dDeviceContext;
    ComPtr<ID2D1Bitmap1> bitmap;
    D2D1_SIZE_F bmpSize = bitmap->GetSize();

    From above code, I can get the size of a ID2D1Bitmap.
    and it's size is 600 X 1512 which means ID2D1DeviceContext can draw an area of 600 X 1512 at once.

    And my screen resolution is 1366 X 768.
    And I set m_virtualSIS = ref new VirtualSurfaceImageSource(600, 3528, true);

    So I can understand the Bitmap's width which is 600, but why the bitmap's height is 1512.

    Besides this, I find the magazine example(http://code.msdn.microsoft.com/Magazine-Sample-2a657289),
    .It's bitmap size created by CreateBitmapFromDxgiSurface is 600 X 768.

    So I want to know the relation of IDXGISurface and the size of ID2D1Bitmap.






    • Edited by Jumping fish Friday, October 12, 2012 1:56 AM missing word
    Friday, October 12, 2012 1:54 AM