void tsetrect(trect re, double l, double t, double r, double b) { re.left = l; re.top = t; re.right = r; re.bottom = b; re.isIn = lastx >= re.left && lastx < re.right && lasty >= re.top && lasty < re.bottom; }
void drawtrect(DrawContext c, trect tr, double r, double g, double bl) { var p = new Path(FillMode.Winding); var b = new SolidColorBrush(); b.R = r; b.G = g; b.B = bl; b.A = 1.0; if (tr.isIn) { b.R += b.R * 0.75; b.G += b.G * 0.75; b.B += b.B * 0.75; } p.AddRectangle(tr.left, tr.top, tr.right - tr.left, tr.bottom - tr.top); p.End(); c.Fill(p, b); p.Free(); }