在C
我有
int left = ..., top = ..., width = ..., height = ...;
void *pixels = GetScreenshot(left, top, width, height);
// use JNI to call SaveImageToGallery
::free(pixels);
在Java中我有
public void SaveImageToGallery(int[] pixels, int width, int height)
{
// ...
}
如何使用JNI将pixels
传递给Java函数SaveImageToGallery
而不复制它们?