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


C# LTexture.GetImage方法代码示例

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


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

示例1: PutImage

		public int PutImage(string name, LTexture tex2d) {
			if (tex2d != null) {
				return PutImage(name, tex2d.GetImage());
			}
			return count;
		}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:6,代码来源:LTexturePack.cs

示例2: Init

	private void Init(LTexture tex2d, float limit, bool remove, float scale) {
		this.isVisible = true;
		this.expandLimit = limit;
		this.width = tex2d.GetWidth();
		this.height = tex2d.GetHeight();
		this.scaleWidth = (int) (width * scale);
		this.scaleHeight = (int) (height * scale);
		this.loopMaxCount = (MathUtils.Max(scaleWidth, scaleHeight) / 2) + 1;
		this.fractions = new float[(scaleWidth * scaleHeight) * maxElements];
		this.exWidth = (int) (scaleWidth * expandLimit);
		this.exHeigth = (int) (scaleHeight * expandLimit);
		LImage image = tex2d.GetImage().ScaledInstance(scaleWidth, scaleHeight);
		Color[] pixels = image.GetPixels();
		if (image != null) {
			image.Dispose();
			image = null;
		}
		this.size = pixels.Length;
		this.pixmap = new LPixmapData(exWidth, exHeigth, true);
		int no = 0, idx = 0;
        int length = fractions.Length;
		float angle = 0;
		float speed = 0;
		System.Random random = LSystem.random;
		for (int y = 0; y < scaleHeight; y++) {
			for (int x = 0; x < scaleWidth; x++) {
				if (idx + maxElements < length) {
					no = y * scaleWidth + x;
					angle = random.Next(360);
                    speed = 10f / random.Next(30);
					fractions[idx + 0] = x;
					fractions[idx + 1] = y;
					fractions[idx + 2] = (MathUtils.Cos(angle * MathUtils.PI
							/ 180) * speed);
					fractions[idx + 3] = (MathUtils.Sin(angle * MathUtils.PI
							/ 180) * speed);
					fractions[idx + 4] = (pixels[no].PackedValue == 0xff00 ? 0xffffff
							: pixels[no].PackedValue);
					fractions[idx + 5] = x / 6 + random.Next(10);
					idx += maxElements;
				}
			}
		}
		if (remove) {
			if (tex2d != null) {
				tex2d.Destroy();
				tex2d = null;
			}
		}
		this.tmp = tex2d;
		this.StartUsePixelThread();
	}
开发者ID:keppelcao,项目名称:LGame,代码行数:52,代码来源:FractionEffect.cs


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