Platforms to show: All Mac Windows Linux Cross-Platform

Back to WIATransferCallbackMBS class.

WIATransferCallbackMBS.GetNextStream(ItemName as string, FullItemName as string) as WIAStreamMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No
Gets a new stream for the specified item.

ItemName: Specifies the name of the item to create stream for.
FullItemName: Specifies the full name of the item to create stream for.

Returns a new WIAStreamMBS object or nil for an error.

When this method is implemented by an image processing filter, the Windows Image Acquisition (WIA) 2.0 minidriver calls it during image acquisition to get the destination stream from the client.

A filter's WIATransferCallbackMBS.GetNextStream must delegate to the application's callback method. The filter uses the stream returned by the application callback's WIATransferCallbackMBS.GetNextStream implementation to create its own stream that it passes back to the WIA 2.0 service. The filtering is done when the filter's stream calls the IStream::Write method.

The filter's stream cannot make any assumptions on the number of bytes that are written to it on each write, since the unfiltered image data may come from the WIA 2.0 Preview Component rather than the driver. The WIA 2.0 Preview Component always writes the whole unfiltered image data into the filter's stream only once, which means that the filter's stream has one source writing into it. If both the driver and the preview component write into the filter's stream, the filter's stream cannot assume, for example, that it will receive the full header the first time IStream::Write is called although its corresponding driver always writes the header data first in one write. Nor can it assume that a subsequent write contains exactly one scan line. So the filtering stream may have to count the number of bytes written to it to determine, for example, where the image data starts.

The image processing filter's WIATransferCallbackMBS.GetNextStream implementation should read the properties needed for its image processing from the item for which the image is being acquired. The filter does not read the properties directly from the pWiaItem2 passed into InitializeFilter. Instead the filter must call FindItemByName on this WIA 2.0 item to obtain the actual WIA 2.0 item. The reason for this is that the image being acquired may actually be a child item of pWiaItem2. For example, during a folder acquisition the filter uses pWiaItem2 to obtain pWiaItem2's child items in WIATransferCallbackMBS.GetNextStream (during a folder acquisition the driver returns the images represented by the child items of WiaItemMBS). The same is true when the WIA 2.0 Preview Component calls into the image processing filter passing a child WIA 2.0 item.

Some examples using this event:

WIATransferCallbackMBS.TransferCallback(w as WIATransferParamsMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Image Capture MBS Win Plugin 10.3 ❌ No ✅ Yes ❌ No ❌ No
Provides progress and other notifications during a transfer.

Returns an error value or zero on success.

Some examples using this event:

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...