本文整理汇总了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);
}
示例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));
}