当前位置: 首页>>代码示例>>C#>>正文


C# BitmapBuffer.UnlockBits方法代码示例

本文整理汇总了C#中BizHawk.Bizware.BizwareGL.BitmapBuffer.UnlockBits方法的典型用法代码示例。如果您正苦于以下问题:C# BitmapBuffer.UnlockBits方法的具体用法?C# BitmapBuffer.UnlockBits怎么用?C# BitmapBuffer.UnlockBits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BizHawk.Bizware.BizwareGL.BitmapBuffer的用法示例。


在下文中一共展示了BitmapBuffer.UnlockBits方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadTextureData

		public unsafe void LoadTextureData(Texture2d tex, BitmapBuffer bmp)
		{
			sdi.BitmapData bmp_data = bmp.LockBits();
			var tw = tex.Opaque as TextureWrapper;
			var dr = tw.Texture.LockRectangle(0, LockFlags.None);

			//TODO - do we need to handle odd sizes, weird pitches here?
			if (bmp.Width * 4 != bmp_data.Stride)
				throw new InvalidOperationException();

			dr.Data.WriteRange(bmp_data.Scan0, bmp.Width * bmp.Height * 4);
			dr.Data.Close();

			tw.Texture.UnlockRectangle(0);
			bmp.UnlockBits(bmp_data);
		}
开发者ID:SaxxonPike,项目名称:BizHawk,代码行数:16,代码来源:IGL_SlimDX9.cs

示例2: LoadTextureData

		public void LoadTextureData(Texture2d tex, BitmapBuffer bmp)
		{
			sdi.BitmapData bmp_data = bmp.LockBits();
			try
			{
				GL.BindTexture(TextureTarget.Texture2D, (int)tex.Opaque);
				GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, bmp.Width, bmp.Height, PixelFormat.Bgra, PixelType.UnsignedByte, bmp_data.Scan0);
			}
			finally
			{
				bmp.UnlockBits(bmp_data);
			}
		}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:13,代码来源:IGL_TK.cs

示例3: ResolveTexture2d

		public unsafe BitmapBuffer ResolveTexture2d(Texture2d tex)
		{
			//note - this is dangerous since it changes the bound texture. could we save it?
			BindTexture2d(tex);
			var bb = new BitmapBuffer(tex.IntWidth, tex.IntHeight);
			var bmpdata = bb.LockBits();
			GL.GetTexImage(TextureTarget.Texture2D, 0, PixelFormat.Bgra, PixelType.UnsignedByte, bmpdata.Scan0);
			var err = GL.GetError();
			bb.UnlockBits(bmpdata);
			return bb;
		}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:11,代码来源:IGL_TK.cs

示例4: LoadTextureData

        public void LoadTextureData(Texture2d tex, BitmapBuffer bmp)
        {
            sdi.BitmapData bmp_data = bmp.LockBits();
            d3d9.Texture dtex = tex.Opaque as d3d9.Texture;
            var dr = dtex.LockRectangle(0, LockFlags.None);

            //TODO - do we need to handle odd sizes, weird pitches here?
            dr.Data.WriteRange(bmp_data.Scan0, bmp.Width * bmp.Height);
            dtex.UnlockRectangle(0);
            bmp.UnlockBits(bmp_data);
        }
开发者ID:cas1993per,项目名称:bizhawk,代码行数:11,代码来源:IGL_SlimDX9.cs


注:本文中的BizHawk.Bizware.BizwareGL.BitmapBuffer.UnlockBits方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。