문제

Here is the situation:

I have got the array of bytes containing the bitmap header together with the bitmap data. I know the offset of data, and I need to generate BitmapFrame for later rendering. I wanted to avoid array cells copying and created a wrapper for a part of the array ( ArraySegment ).

Then I render this bitmap together with a primitive into the RenderTargetBitmap, which is, in turn, saved to the same array (in place of data) using CopyPixels.

I have noticed, that if I work on the original data, with an array wrapper I get the wrong final image. However if I copy the same data to another array and provide it to static Create method of BitmapFrame class, the result is correct.

Do you have any ideas what happens?

Thank you in advance for the replies!

Cheers

도움이 되었습니까?

해결책

OK, I have identified the problem - a property of ArraySegment returns the original array - no the subarray...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top