//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));
        }
            public override void onDataChange(DataSnapshot dataSnapshot)
            {
                foreach (DataSnapshot segmentSnapshot in dataSnapshot.Children)
                {
                    Segment segment = segmentSnapshot.getValue(typeof(Segment));
                    buffer.drawPath(DrawingView.getPathForPoints(segment.Points, scale), DrawingView.paintFromColor(segment.Color));
                }
                string encoded = encodeToBase64(b);

                metadataRef.child("thumbnail").setValue(encoded, new CompletionListenerAnonymousInnerClassHelper2(this));
            }