Error, "Parameter is not valid" and "Out of memory" Draw Image

Error, "Parameter is not valid" and "Out of memory" Draw Image


Everything work normal. If i move head to corner, the area capture of camera only sea some hair then it show this issues "Parameter is not valid" and "Out of memory"


PXCMImage.ImageData data;
if (image.AcquireAccess(PXCMImage.Access.ACCESS_READ, PXCMImage.ColorFormat.COLOR_FORMAT_RGB32, out data) >= pxcmStatus.PXCM_STATUS_NO_ERROR)
  PXCMImage.ImageInfo imageInfo = image.imageInfo;
  form.DisplayBitmap(data.ToBitmap(imageInfo.width, imageInfo.height));
  image.ReleaseAccess(ref data);

  lock (this)
   bitmap = new Bitmap(picture);
catch (Exception ex)
     //Error: Parameter is not valid.
     //Error: Out of memory.

Anyone have this issue and have any solution for this?

It work well only when move head to corner it will show this.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I did not have the whole code. Here is my question. Where did you release the image? You need use image.Dispose() to release the image.

Thank you David Lu,

It look worked well, i have 2 functions display and have one i missed dispose() it.

Thank you!

Leave a Comment

Please sign in to add a comment. Not a member? Join today