Copy to correct offset.
Offset into image is y * stride, not y * bpp.
This commit is contained in:
parent
5b4f75ab68
commit
2bb0f945f9
1 changed files with 2 additions and 1 deletions
|
@ -32,8 +32,9 @@ namespace Examples.Tutorial
|
|||
for (int y = 0; y < bitmap.Height; ++y)
|
||||
{
|
||||
var offset = new IntPtr(data.Scan0.ToInt64() + (data.Stride * y));
|
||||
var stride = bitmap.Width * 4;
|
||||
System.Runtime.InteropServices.Marshal.Copy(
|
||||
offset, rgba, y * 4, bitmap.Width * 4);
|
||||
offset, rgba, y * stride, stride);
|
||||
}
|
||||
|
||||
var cursor = new OpenTK.MouseCursor(rgba, bitmap.Width, bitmap.Height, 0, 0);
|
||||
|
|
Loading…
Reference in a new issue