(I've made three posts in the last week on SO regarding a Java project I'm working on. I feel guilty, but what the hell, your answers are amazing.)
Here's a chunk of code in C#:
Bitmap bitmap = ...
int dstStride = bitmap.Stride;
byte* bdst = (byte*)bitmap.Scan0;
I want to make an equivalent algorithm in Java. I'm beginning to think this is impossible, based on other, similar questions.
I can actually replicate the stride info of my bitmap, but of course, that byte*
is nigh impossible to reproduce. What happens later is that there's a for
loop that manipulates the bitmap image, a la:
bdst[x * 3 + y * dstStride + 2] = (byte)(alpha * bsrc[dx * 3 + L * srcStride + 2]);
(x & y are iterators in a loop)
Naturally I'm unable to simply make bdst a byte array because that doesn't make sense. According to this totally awesome article, Scan0 is "[t]he address in memory of the fixed data array."
And judging by the above SO post, this is not possible in Java. Confirm / deny?