PXC Family

Datasheet (PDF)

Manual & Guide

Application Notes

Driver Updates

Example Source Code

Compatible Image Processing Software

Product FAQ

Home Page

Feedback at:
CSinfo@cyberoptics.com or

PXCBASIC_NET Samples for Win32 Systems

Win32 Systems (Win95, 98, Me, NT, 2000 and XP)

The PXCBASIC_NET and PXCBASIC2_NET samples are two programs that use the same mechanism for displaying video in a window. The differences between the programs is in their use of the queuing facility in the PXC library. See the individual program descriptions below. Please feel free to use our samples as starting points for your applications.

These two samples show the correct way to initialize and exit the PXC200 libraries. They also show one method of implementing a real-time or nearly real-time video display by using a timer. PXCBASIC_NET uses a single buffer and achieves a display rate of 12 (CCIR/PAL) or 16 (NTSC) frames per second. PXCBASIC2_NET uses two buffers and achieves (on most computers) a real-time display of 25 (CCIR/PAL) or 30 (NTSC) frames per second.

We think these samples should make sense right away. Please feel free to dive in and modify them for your own use. The complete API is presented in the Imagenation PXC200A Color Frame Grabber User's Guide.

Detailed Explanation of the Display Mechanism
Both examples get a pointer to an image buffer and use that pointer to create a bitmap.

'Get a pointer to an image buffer
ptr = FRAME_FrameBuffer(frh)
If (ptr = 0) Then
    MessageBox.Show("Grab failed.");
End If

'To create a bitmap we need the pixel format and size
If (pbits = PBITS_Y8) Then
    PSize = ImageWidth
    Pformat = Drawing.Imaging.PixelFormat.Format8bppIndexed
    PSize = ImageWidth * 3
    Pformat = Drawing.Imaging.PixelFormat.Format24bppRgb
End If

'Create a bitmap
bmp = New Bitmap(ImageWidth + 1, ImageHeight, PSize, Pformat, New System.IntPtr(ptr))

'Now display the bitmap
PictureBox.Image = bmp

This is the simplest and slowest sample. It uses a NON-QUEUED grab which means it wastes a field time (16ms or 13ms) waiting for the grab to complete. This sample has a maximum theoretical speed of 20 frames per second if it can get the display done in 1 field time (16ms or 13ms). That means it would grab a frame, skip a field, grab a frame, etc.

This sample uses QUEUED frame grabs and two buffers. It keeps the image buffers full by using 2 queued grabs. It flips an image and requeues the next grab while it sends the image to a window. If this sample can grab image and requeue the next one fast enough, it can achieve real-time display On most newer computers, this sample should display 25 (CCIR) or 30 (NTSC) fps.