smithdale87
Lurker
Hi, I have a custom drawable, where I draw a base bitmap image, then part of an image over the top of that that is clipped to a certain rectangle. For the overlayed image, I am trying to blur the edges, and I thought I could accomplish that using a BlurMaskFilter, however, I'm not seeing any blurring occurring.
Here is the content of the draw method from my Drawable class:
The result is almost correct, except the overlay image is not being blurred.
This code is written in C# using Xamarin, so I realize that some things are slightly different, but the overall methods will be the same.
Any help is much appreciated.
Here is the content of the draw method from my Drawable class:
The result is almost correct, except the overlay image is not being blurred.
Code:
...
m_paint = new Paint();
m_blurPaint = new Paint();
m_blurPaint.SetMaskFilter(new BlurMaskFilter(blurRadius, BlurMaskFilter.Blur.Outer));
...
public override void Draw(Canvas canvas)
{
Rect clipRect = canvas.ClipBounds;
canvas.ClipRect(clipRect);
canvas.DrawBitmap(m_baseImage, 0, 0, m_paint);
if (IsRunning)
{
canvas.Save();
clipRect.Left = (int) m_currentOffset;
clipRect.Right = (int) (clipRect.Left + m_progressWidth);
canvas.ClipRect(clipRect);
//TODO: Figure out why edges are not blurring correctly
canvas.DrawBitmap(m_overlayImage, 0, 0, m_blurPaint);
canvas.Restore();
}
}
This code is written in C# using Xamarin, so I realize that some things are slightly different, but the overall methods will be the same.
Any help is much appreciated.