Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions WindowsAPICodePack/DirectX/DirectX/WIC/WICBitmapSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cli::array<unsigned char>^ BitmapSource::CopyPixels()
rect.Height = size.Height;

// Force the stride to be a multiple of sizeof(DWORD)
UINT stride = rect.Height * 4;
UINT stride = rect.Width * 4;
stride = ((stride + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD);
UINT bufferSize = stride * rect.Height;

Expand All @@ -106,7 +106,7 @@ IntPtr BitmapSource::CopyPixelsToMemory( BitmapRectangle rectangle )
rect.Height = rectangle.Height;

// Force the stride to be a multiple of sizeof(DWORD)
UINT stride = rect.Height * 4;
UINT stride = rect.Width * 4;
stride = ((stride + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD);
UINT bufferSize = stride * rect.Height;

Expand All @@ -132,7 +132,7 @@ IntPtr BitmapSource::CopyPixelsToMemory()
rect.Height = size.Height;

// Force the stride to be a multiple of sizeof(DWORD)
UINT stride = rect.Height * 4;
UINT stride = rect.Width * 4;
stride = ((stride + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD);
UINT bufferSize = stride * rect.Height;

Expand Down