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


C# Canvas.drawRect方法代码示例

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


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

示例1: onDraw

		protected internal override void onDraw(Canvas canvas)
		{
			canvas.drawColor(Color.DKGRAY);
			canvas.drawRect(0, 0, mBitmap.Width, mBitmap.Height, paintFromColor(Color.WHITE, Paint.Style.FILL_AND_STROKE));

			canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);

			canvas.drawPath(mPath, mPaint);
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:9,代码来源:DrawingView.cs

示例2: updateThumbnail

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public static void updateThumbnail(int boardWidth, int boardHeight, com.firebase.client.Firebase segmentsRef, final com.firebase.client.Firebase metadataRef)
		public static void updateThumbnail(int boardWidth, int boardHeight, Firebase segmentsRef, Firebase metadataRef)
		{
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final float scale = Math.min(1.0f * THUMBNAIL_SIZE / boardWidth, 1.0f * THUMBNAIL_SIZE / boardHeight);
			float scale = Math.Min(1.0f * THUMBNAIL_SIZE / boardWidth, 1.0f * THUMBNAIL_SIZE / boardHeight);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.graphics.Bitmap b = android.graphics.Bitmap.createBitmap(Math.round(boardWidth * scale), Math.round(boardHeight * scale), android.graphics.Bitmap.Config.ARGB_8888);
			Bitmap b = Bitmap.createBitmap(Math.Round(boardWidth * scale), Math.Round(boardHeight * scale), Bitmap.Config.ARGB_8888);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.graphics.Canvas buffer = new android.graphics.Canvas(b);
			Canvas buffer = new Canvas(b);

			buffer.drawRect(0, 0, b.Width, b.Height, DrawingView.paintFromColor(Color.WHITE, Paint.Style.FILL_AND_STROKE));
			Log.i(TAG, "Generating thumbnail of " + b.Width + "x" + b.Height);

			segmentsRef.addListenerForSingleValueEvent(new ValueEventListenerAnonymousInnerClassHelper3(metadataRef, scale, b, buffer));
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:19,代码来源:DrawingActivity.cs


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