Click or drag to resize

IMcImagesAdd Method

Creates a new IMcImage instance and optionally adds it to the McImages collection.

Namespace:  MediaCy.IQL.Engine
Assembly:  MediaCy.IQL.Engine (in MediaCy.IQL.Engine.dll) Version: 10.0.6912.0
Syntax
VB
Function Add ( 
	Optional Name As String = "",
	Optional Width As Integer = 0,
	Optional Height As Integer = 0,
	Optional FrameCount As Integer = 1,
	Optional Type As Object = 1,
	Optional ImageCreationFlags As mcImageCreateFlags = mcImageCreateFlags.mcicfDefault
) As McImage

Parameters

Name (Optional)
Type: SystemString
The name given to both the McImage.Name and McImage.DisplayName properties. The Name property is changed to make it "parseable" and to avoid collisions with other users of the name. If an empty name is supplied, the Name is "untitled0". See McImage.Name for more details.
Width (Optional)
Type: SystemInt32
Width of each image frame, in pixels.
Height (Optional)
Type: SystemInt32
Height of each frame, in pixels.
FrameCount (Optional)
Type: SystemInt32
Number of frames to initially allocate. If the mcicfContiguous mcImageCreateFlags bit is set in the Flags argument, then all frames will share the same memory block. Only do this for small frames (less than 512 KB in size) and try to limit the total memory required (much less than 128 MB is best, even if you have a lot of physical memory installed). Placing too many frames into one huge memory block limits the flexibilty of the image memory manager and can lead to disk "thrashing" or to out-of-memory errors.
Type (Optional)
Type: SystemObject
This can be an instance of a McImageType interface or it can be a numeric "QuickType" (See mcImageQuickTypes).
ImageCreationFlags (Optional)
Type: MediaCy.IQL.EnginemcImageCreateFlags

Return Value

Type: McImage
The new McImage instance.
Remarks
An McImage instance is created with a specified name, size, pixel type, and number of frames. By default the new image is also added to the Engine.Images collection. A SNC_NOTIFY_IMS_IMAGE_WAS_ADDED SpecialNotify is sent to standard notify clients of the Engine.Images collection after an image is added to the collection; the SpecialNotify VARIANT* pvarNotifyData argument will point to a VT_DISPATCH Variant holding an instance pointer to the newly created McImage. By default the new image is also added to the Engine.Images collection, however if the mcicfNoAddToCollection Flag bit is set, then the image is not made part of the collection, and it will exist only as long as an AddRef is held on the returned IMcImage instance pointer. All images are backed by a McObject instance which bears the McImage.Name property with Engine.McObject(Engine.Images) as its ParentMcObject. All McObject instances connected to McImage instances have the McObject.Category property "McImage". "For each" enumerations will only find McImage instances which are part of the collection, and there is no need to keep an AddRef on the interface instance. McImages.Item will return only collection members for numeric (index value) arguments, but it will find any image with a matching Name for string arguments, whether the image is part of the images collection or not. No SNC_NOTIFY_IMS_IMAGE_WAS_ADDED SpecialNotify is fired if the new image is not to be part of the collection (mcicfNoAddToCollection Flag bit set). However, notify clients can call the McObjects.AttachNotifySinkToCategory to get notifies whenever an object is added to the "McImage" category. Note that at the time this notification is sent, the new image will not yet be part of the images collection.
See Also