Software Archive
Read-only legacy content
17061 Discussions

SR300 Display/Record problems

zhang_e_
Beginner
227 Views

I have two questions
1. The screen display is not complete problem
But displayed image is not a complete picture, how can I automatically scaled according to my picturebox

For example, I should complete image as a blue border, but my picturebox image display range is only of only the red border

Snap12.png

 It is my code
private void button3_Click(object sender, EventArgs e)
        {
            PXCMSession session =
            PXCMSession.CreateInstance();
            PXCMSession.ImplVersion version =
                               session.QueryVersion();
            textBox1.Text = version.major.ToString() + "."
                               + version.minor.ToString();
            PXCMSenseManager sm =
                             session.CreateSenseManager();
            sm.EnableStream(
                 PXCMCapture.StreamType.STREAM_TYPE_COLOR,
                 0, 0);
            sm.Init();
            pxcmStatus status = sm.AcquireFrame(true);
            PXCMCapture.Sample sample = sm.QuerySample();
            PXCMImage image = sample.color;
            PXCMImage dimage = sample.depth;

            PXCMImage.ImageData data;
            image.AcquireAccess(
                 PXCMImage.Access.ACCESS_READ,
                 PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32,
                 out data);
            Bitmap bm = data.ToBitmap(0,
                                      image.info.width,
                                      image.info.height);
            pictureBox1.Image = bm;

            sm.ReleaseFrame();
            sm.Close();
            session.Dispose();
        }


2. How to record images

0 Kudos
1 Reply
RBang
New Contributor II
227 Views

1. Based on the code you have pasted, this snippet:

Bitmap bm = data.ToBitmap(0,image.info.width,image.info.height);

Is what is governing the size of your image. So if you replace them by values instead, it should work as you intend it to.


2. Moreover, this should provide more insight regarding your concern:

Recording and Playing Back

http://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?doc_essential_record_and_playback_streams.html

0 Kudos
Reply