• English
  • Deutsch

IC Imaging Control .NET

FrameExtensions.CreateBitmapWrap Method

FrameExtensions.CreateBitmapWrap Method

Creates a System.Drawing.Bitmap object which internally points to the same memory as the IFrame.
public static System.Drawing.Bitmap CreateBitmapWrap( this IFrame frm );
Parameter Description

The IFrame to use for the Bitmap object.


Either a pointer to a valid System.Drawing.Bitmap object or a nullptr if the IFrame parameter could not be converted to a Bitmap.


The Bitmap object created points to the same memory as the IFrame and so when you free the IFrame (or change its contents) this will effect the returned Bitmap by either changing the contents of Bitmap or leading to spurious crashes when unsing the Bitmap object.

The FrameType of the IFrame passed in must contain something that a Bitmap may handle. When FrameType.PixelFormat returns something undefined this method returns nullptr.

Note: FrameExtensions.CreateBitmapCopy copies the full image data, so it is slower then FrameExtensions.CreateBitmapWrap on the other hand, you cannot use a Bitmap created by FrameExtensions.CreateBitmapWrap without meticulous tracking its lifetime.


Introduced in version 3.5

See also: FrameExtensions, IFrame, IFrame.FrameType, FrameType.PixelFormat, FrameExtensions.CreateBitmapCopy

<< FrameExtensions

Get in touch with us

About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, video converters and embedded vision components for factory automation, quality assurance, medicine, science, security and a variety of other markets.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE, MIPI interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

ISO 9001:2015 certified MVTEC | Edge AI + Vision Alliance | EMVA

Contact us