User`s guide
2 Introduction
2-16
Creating the Update Preview Window Function
When preview calls the update preview window function you specify, it passes your
function the following arguments.
Argument Description
obj Handle to the video input object being previewed
A data structure containing the following fields:
Data Current image frame specified as an H-by-W-by-
B array, where H is the image height and W is
the image width, as specified in the ROIPosition
property, and B is the number of color bands, as
specified in the NumberOfBands property
Resolution Text string specifying the current image width and
height, as defined by the ROIPosition property
Status String describing the status of the video input
object
event
Timestamp String specifying the time associated with the
current image frame, in the format hh:mm:ss:ms
himage Handle to the image object in which the data is to be displayed
The following example creates an update preview window function that displays the
timestamp of each incoming video frame as a text label in the custom GUI. The update
preview window function uses getappdata to retrieve a handle to the text label
uicontrol object from application-defined data in the image object. The custom GUI
stores this handle to the text label uicontrol object — see “Specifying the Update
Preview Function” on page 2-17.
Note that the update preview window function also displays the video data by updating
the CData of the image object.
function mypreview_fcn(obj,event,himage)
% Example update preview window function.
% Get timestamp for frame.
tstampstr = event.Timestamp;
% Get handle to text label uicontrol.