DirectX

Directx2D :

       http://www.cnblogs.com/graphics/category/412802.html

       https://msdn.microsoft.com/zh-cn/library/windows/desktop/dd370990(v=vs.85).aspx

        https://msdn.microsoft.com/zh-cn/library/windows/desktop/dd371800(v=vs.85).aspx

        https://social.msdn.microsoft.com/Forums/zh-CN/0e18ea98-f5d8-4922-850f-1d0380c753f6/cant-create-rgb565-bitmap-using-direct2d-createbitmap?forum=w81prevwCplus


https://github.com/yanhua2002/Direct2DSample



unsigned int D[100 * 100] = { 100 };


for (int i = 0; i < 100 * 100; i++)D[i] = 100;


//m_pRenderTarget->CreateBitmap(D2D1::SizeU(100, 100), D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE)), &m_pBitmap);

m_pRenderTarget->CreateBitmap(D2D1::SizeU(100, 100), D, 100*100, D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE)), &m_pBitmap);

//m_pBitmap->CopyFromMemory(&ru, D, NULL);


D2D1_SIZE_F size = m_pBitmap->GetSize();

D2D1_POINT_2F upperLeftCorner = D2D1::Point2F(0.f, 0.f);


m_pRenderTarget->DrawBitmap(m_pBitmap, D2D1::RectF(upperLeftCorner.x,upperLeftCorner.y, upperLeftCorner.x + size.width, upperLeftCorner.y + size.height));


你可能感兴趣的:(DirectX)