private static DrawBackGlassNormalPercent ( |
||
context | ||
rect | ||
backColor1 | Color | |
backColor2 | Color | |
orientation | VisualOrientation | |
path | ||
glassPercent | float | |
memento | IDisposable | |
return | IDisposable |
private static IDisposable DrawBackGlassNormalPercent(RenderContext context,
Rectangle rect,
Color backColor1,
Color backColor2,
VisualOrientation orientation,
GraphicsPath path,
float glassPercent,
IDisposable memento)
{
using (Clipping clip = new Clipping(context.Graphics, path))
{
MementoDouble cache;
if ((memento == null) || !(memento is MementoDouble))
{
if (memento != null)
memento.Dispose();
cache = new MementoDouble();
memento = cache;
}
else
cache = (MementoDouble)memento;
// Get the drawing rectangle for the path
RectangleF drawRect = new RectangleF(rect.X, rect.Y, rect.Width, rect.Height);
// Draw the border as a lighter version of the inside
cache.first = DrawBackGlassLinear(drawRect, drawRect,
Color.White,
Color.White,
_glassColorTopL,
_glassColorBottomL,
orientation,
context.Graphics,
glassPercent,
cache.first);
// Reduce by 1 pixel on all edges to get the inside
RectangleF insetRect = drawRect;
insetRect.Inflate(-1f, -1f);
// Draw the inside area
cache.second = DrawBackGlassLinear(insetRect, drawRect,
backColor1, backColor2,
_glassColorTopL,
_glassColorBottomL,
orientation,
context.Graphics,
glassPercent,
cache.second);
}
return memento;
}