Windows Media Encoder SDK banner art

The CroppingLeftMargin property specifies and retrieves the number of rows to be removed from the left edge of an image.


int = IWMEncVideoSource.CroppingLeftMargin;
IWMEncVideoSource.CroppingLeftMargin = int;


This property takes no parameters.

Property Value

An Int32 type that indicates how many rows of pixels to crop.

If this property fails, it returns an error number.

Number Description
0xC00D0011 This property cannot be set while the encoder engine is running.


The cropped image is adjusted to fill the destination size specified in the associated profile.

Example Code

using WMEncoderLib;

// Create a WMEncoder object.
WMEncoder Encoder;
Encoder = new WMEncoder();

// Specify the source for the input stream.
IWMEncSourceGroupCollection SrcGrpColl;
IWMEncSourceGroup SrcGrp;
IWMEncVideoSource SrcVid;
IWMEncSource SrcAud;

// Add a source group to the collection.
SrcGrpColl = Encoder.SourceGroupCollection;
SrcGrp = SrcGrpColl.Add("SG_1");

// Add a video and an audio source to the source group.
SrcVid = (IWMEncVideoSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);

// Specify the cropping margins.
SrcVid.CroppingBottomMargin = 5;
SrcVid.CroppingTopMargin = 5;
SrcVid.CroppingLeftMargin = 3;
SrcVid.CroppingRightMargin = 3;

// Continue configuring the encoding session.

catch (Exception e)
     // TODO: Handle exceptions.


Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also