本文整理汇总了C#中MonoTouch.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# MonoTouch.Dispose方法的具体用法?C# MonoTouch.Dispose怎么用?C# MonoTouch.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTouch
的用法示例。
在下文中一共展示了MonoTouch.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DidOutputSampleBuffer
public override void DidOutputSampleBuffer (AVCaptureOutput captureOutput, MonoTouch.CoreMedia.CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
{
try {
using (var pixelBuffer = sampleBuffer.GetImageBuffer () as CVPixelBuffer){
int width = pixelBuffer.Width;
int height = pixelBuffer.Height;
if (container.ripple == null || width != textureWidth || height != textureHeight){
textureWidth = width;
textureHeight = height;
container.SetupRipple (textureWidth, textureHeight);
}
CleanupTextures ();
// Y-plane
GL.ActiveTexture (All.Texture0);
All re = (All) 0x1903; // GL_RED_EXT, RED component from ARB OpenGL extension
CVReturn status;
lumaTexture = container.videoTextureCache.TextureFromImage (pixelBuffer, true, re, textureWidth, textureHeight, re, DataType.UnsignedByte, 0, out status);
if (lumaTexture == null){
Console.WriteLine ("Error creating luma texture: {0}", status);
return;
}
GL.BindTexture ((All)lumaTexture.Target, lumaTexture.Name);
GL.TexParameter (All.Texture2D, All.TextureWrapS, (int) All.ClampToEdge);
GL.TexParameter (All.Texture2D, All.TextureWrapT, (int) All.ClampToEdge);
// UV Plane
GL.ActiveTexture (All.Texture1);
re = (All) 0x8227; // GL_RG_EXT, RED GREEN component from ARB OpenGL extension
chromaTexture = container.videoTextureCache.TextureFromImage (pixelBuffer, true, re, textureWidth/2, textureHeight/2, re, DataType.UnsignedByte, 1, out status);
if (chromaTexture == null){
Console.WriteLine ("Error creating chroma texture: {0}", status);
return;
}
GL.BindTexture ((All) chromaTexture.Target, chromaTexture.Name);
GL.TexParameter (All.Texture2D, All.TextureWrapS, (int)All.ClampToEdge);
GL.TexParameter (All.Texture2D, All.TextureWrapT, (int) All.ClampToEdge);
}
} finally {
sampleBuffer.Dispose ();
}
}