On further testing, my original version is one scan line off. And stride may not
be the same as 4*w, ie padding bytes in the end of each scan line. So a revised
version is
z=. |.^:(s<0) w&{."1^:(w~:|s%4) (h,|s%4)$memr p,((s<0)*s*<:h),(h*<.|s%4),JINT
bill lam wrote:
GdipBitmapLockBits assume bitmap is always top-down (positive stride),
but it may not always true, wine's gdiplus give a bottom-up one. I
suggest checking stride in DATA,
z=. |.^:(s<0) (h,w)$memr p,((s<0)*_4*w*h),(w*h),JINT
Also wine does not accept null pointer for rect in GdipBitmapLockBits,
so you may consider pass a valid rect structure to it by first calling
GdipGetImageWidth and GdipGetImageHeight.
I did not try but I think the current platimg will not run under win-x64.
regards,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm