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


C# android.getMatrix方法代码示例

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


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

示例1: invalidateChild

		public virtual void invalidateChild(android.view.View child, android.graphics.Rect
			 dirty)
		{
			android.view.ViewParent parent = this;
			android.view.View.AttachInfo attachInfo = mAttachInfo;
			if (attachInfo != null)
			{
				// If the child is drawing an animation, we want to copy this flag onto
				// ourselves and the parent to make sure the invalidate request goes
				// through
				bool drawAnimation = (child.mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION;
				if (dirty == null)
				{
					if (child.mLayerType != LAYER_TYPE_NONE)
					{
						mPrivateFlags |= INVALIDATED;
						mPrivateFlags &= ~DRAWING_CACHE_VALID;
						child.mLocalDirtyRect.setEmpty();
					}
					do
					{
						android.view.View view = null;
						if (parent is android.view.View)
						{
							view = (android.view.View)parent;
							if (view.mLayerType != LAYER_TYPE_NONE)
							{
								view.mLocalDirtyRect.setEmpty();
								if (view.getParent() is android.view.View)
								{
									android.view.View grandParent = (android.view.View)view.getParent();
									grandParent.mPrivateFlags |= INVALIDATED;
									grandParent.mPrivateFlags &= ~DRAWING_CACHE_VALID;
								}
							}
							if ((view.mPrivateFlags & DIRTY_MASK) != 0)
							{
								// already marked dirty - we're done
								break;
							}
						}
						if (drawAnimation)
						{
							if (view != null)
							{
								view.mPrivateFlags |= DRAW_ANIMATION;
							}
							else
							{
								if (parent is android.view.ViewRootImpl)
								{
									((android.view.ViewRootImpl)parent).mIsAnimating = true;
								}
							}
						}
						if (parent is android.view.ViewRootImpl)
						{
							((android.view.ViewRootImpl)parent).invalidate();
							parent = null;
						}
						else
						{
							if (view != null)
							{
								if ((view.mPrivateFlags & DRAWN) == DRAWN || (view.mPrivateFlags & DRAWING_CACHE_VALID
									) == DRAWING_CACHE_VALID)
								{
									view.mPrivateFlags &= ~DRAWING_CACHE_VALID;
									view.mPrivateFlags |= DIRTY;
									parent = view.mParent;
								}
								else
								{
									parent = null;
								}
							}
						}
					}
					while (parent != null);
				}
				else
				{
					// Check whether the child that requests the invalidate is fully opaque
					bool isOpaque_1 = child.isOpaque() && !drawAnimation && child.getAnimation() == null;
					// Mark the child as dirty, using the appropriate flag
					// Make sure we do not set both flags at the same time
					int opaqueFlag = isOpaque_1 ? DIRTY_OPAQUE : DIRTY;
					if (child.mLayerType != LAYER_TYPE_NONE)
					{
						mPrivateFlags |= INVALIDATED;
						mPrivateFlags &= ~DRAWING_CACHE_VALID;
						child.mLocalDirtyRect.union(dirty);
					}
					int[] location = attachInfo.mInvalidateChildLocation;
					location[CHILD_LEFT_INDEX] = child.mLeft;
					location[CHILD_TOP_INDEX] = child.mTop;
					android.graphics.Matrix childMatrix = child.getMatrix();
					if (!childMatrix.isIdentity())
					{
						android.graphics.RectF boundingRect = attachInfo.mTmpTransformRect;
//.........这里部分代码省略.........
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:101,代码来源:ViewGroup.cs

示例2: applyTransformation

		protected internal override void applyTransformation(float interpolatedTime, android.view.animation.Transformation
			 t)
		{
			float dx = mFromXDelta;
			float dy = mFromYDelta;
			if (mFromXDelta != mToXDelta)
			{
				dx = mFromXDelta + ((mToXDelta - mFromXDelta) * interpolatedTime);
			}
			if (mFromYDelta != mToYDelta)
			{
				dy = mFromYDelta + ((mToYDelta - mFromYDelta) * interpolatedTime);
			}
			t.getMatrix().setTranslate(dx, dy);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:15,代码来源:TranslateAnimation.cs

示例3: drawChild


//.........这里部分代码省略.........
			int restoreTo = canvas.save();
			if (offsetForScroll)
			{
				canvas.translate(cl - sx, ct - sy);
			}
			else
			{
				canvas.translate(cl, ct);
				if (scalingRequired)
				{
					// mAttachInfo cannot be null, otherwise scalingRequired == false
					float scale = 1.0f / mAttachInfo.mApplicationScale;
					canvas.scale(scale, scale);
				}
			}
			if (transformToApply != null || alpha < 1.0f || !child.hasIdentityMatrix())
			{
				if (transformToApply != null || !childHasIdentityMatrix)
				{
					int transX = 0;
					int transY = 0;
					if (offsetForScroll)
					{
						transX = -sx;
						transY = -sy;
					}
					if (transformToApply != null)
					{
						if (concatMatrix)
						{
							// Undo the scroll translation, apply the transformation matrix,
							// then redo the scroll translate to get the correct result.
							canvas.translate(-transX, -transY);
							canvas.concat(transformToApply.getMatrix());
							canvas.translate(transX, transY);
							mGroupFlags |= FLAG_CLEAR_TRANSFORMATION;
						}
						float transformAlpha = transformToApply.getAlpha();
						if (transformAlpha < 1.0f)
						{
							alpha *= transformToApply.getAlpha();
							mGroupFlags |= FLAG_CLEAR_TRANSFORMATION;
						}
					}
					if (!childHasIdentityMatrix)
					{
						canvas.translate(-transX, -transY);
						canvas.concat(child.getMatrix());
						canvas.translate(transX, transY);
					}
				}
				if (alpha < 1.0f)
				{
					mGroupFlags |= FLAG_CLEAR_TRANSFORMATION;
					if (hasNoCache)
					{
						int multipliedAlpha = (int)(255 * alpha);
						if (!child.onSetAlpha(multipliedAlpha))
						{
							int layerFlags = android.graphics.Canvas.HAS_ALPHA_LAYER_SAVE_FLAG;
							if ((flags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN || layerType != LAYER_TYPE_NONE)
							{
								layerFlags |= android.graphics.Canvas.CLIP_TO_LAYER_SAVE_FLAG;
							}
							if (layerType == LAYER_TYPE_NONE)
							{
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:67,代码来源:ViewGroup.cs

示例4: compose

		/// <summary>Apply this Transformation to an existing Transformation, e.g.</summary>
		/// <remarks>
		/// Apply this Transformation to an existing Transformation, e.g. apply
		/// a scale effect to something that has already been rotated.
		/// </remarks>
		/// <param name="t"></param>
		public virtual void compose(android.view.animation.Transformation t)
		{
			mAlpha *= t.getAlpha();
			mMatrix.preConcat(t.getMatrix());
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:11,代码来源:Transformation.cs

示例5: set

		/// <summary>Clones the specified transformation.</summary>
		/// <remarks>Clones the specified transformation.</remarks>
		/// <param name="t">The transformation to clone.</param>
		public virtual void set(android.view.animation.Transformation t)
		{
			mAlpha = t.getAlpha();
			mMatrix.set(t.getMatrix());
			mTransformationType = t.getTransformationType();
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:9,代码来源:Transformation.cs

示例6: applyTransformation

		protected internal override void applyTransformation(float interpolatedTime, android.view.animation.Transformation
			 t)
		{
			float degrees = mFromDegrees + ((mToDegrees - mFromDegrees) * interpolatedTime);
			float scale = getScaleFactor();
			if (mPivotX == 0.0f && mPivotY == 0.0f)
			{
				t.getMatrix().setRotate(degrees);
			}
			else
			{
				t.getMatrix().setRotate(degrees, mPivotX * scale, mPivotY * scale);
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:14,代码来源:RotateAnimation.cs

示例7: applyTransformation

		protected internal override void applyTransformation(float interpolatedTime, android.view.animation.Transformation
			 t)
		{
			float sx = 1.0f;
			float sy = 1.0f;
			float scale = getScaleFactor();
			if (mFromX != 1.0f || mToX != 1.0f)
			{
				sx = mFromX + ((mToX - mFromX) * interpolatedTime);
			}
			if (mFromY != 1.0f || mToY != 1.0f)
			{
				sy = mFromY + ((mToY - mFromY) * interpolatedTime);
			}
			if (mPivotX == 0 && mPivotY == 0)
			{
				t.getMatrix().setScale(sx, sy);
			}
			else
			{
				t.getMatrix().setScale(sx, sy, scale * mPivotX, scale * mPivotY);
			}
		}
开发者ID:skaslev,项目名称:XobotOS,代码行数:23,代码来源:ScaleAnimation.cs


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