You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, is there a way to directly change byte array of D2DBitmap as it's possible in C++ D2D? Something like this in C++:
// Assuming you have a valid ID2D1Bitmap* named bitmap
D2D1_BITMAP_PROPERTIES bitmapProperties;
bitmap->GetDpi(nullptr, nullptr);
bitmap->GetPixelFormat(&bitmapProperties.pixelFormat);
UINT32 width, height;
bitmap->GetSize(&width, &height);
UINT32 pixelSize = bitmapProperties.pixelFormat.GetPixelSize();
UINT32 stride = width * pixelSize;
D2D1_MAPPED_RECT mappedRect;
HRESULT hr = bitmap->Map(D2D1_MAP_OPTIONS_READ | D2D1_MAP_OPTIONS_WRITE, &mappedRect);
if (SUCCEEDED(hr))
{
BYTE* pixelData = mappedRect.bits;
// Now you can access and modify the pixel data here// Make sure to unmap the bitmap when you're done editing
bitmap->Unmap();
}
It could help us improve the performance, since every time we call CreateBitmapFromMemory, a new bitmap is created in memory.
The text was updated successfully, but these errors were encountered:
Hi, is there a way to directly change byte array of D2DBitmap as it's possible in C++ D2D? Something like this in C++:
It could help us improve the performance, since every time we call CreateBitmapFromMemory, a new bitmap is created in memory.
The text was updated successfully, but these errors were encountered: