https://github.com/jams10/Sprite_Tool

// DXGI Surface로 부터 D2D 비트맵 생성.
hr = pContext->CreateBitmapFromDxgiSurface(pSurface, &bp, &pBitmap);
assert(hr == S_OK);
M_Origin = D2D1::Matrix3x2F::Translation(D2D1_SIZE_F{ width / 2.f, height / 2.f }); // 윈도우 클라이언트 영역의 width, height
M_Mouse = D2D1::Matrix3x2F::Translation(D2D1_SIZE_F{ x, y });
M_Scale = D2D1::Matrix3x2F::Scale(scale,scale, D2D1_POINT_2F{ size.width / 2.f, size.height / 2.f}); // 스프라이트 시트 이미지의 width, height
...
pContext->SetTransform(M_Origin * M_Mouse * M_Scale);
...
pContext->DrawBitmap(
&Bitmap,
D2D1::RectF(-(bsize.width - bsize.width / 2), -(bsize.height - bsize.height / 2), // bsize는 스프라이트 시트 비트맵 사이즈.
(bsize.width - bsize.width / 2), (bsize.height - bsize.height / 2)),
1.0f,
D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
D2D1::RectF(0.0f, 0.0f, bsize.width, bsize.height)
);