Exemple #1
0
 /// <summary>
 /// Gets a skin surface for the given region in the skin. The surface will be stretched at the midline to get the target size.
 /// </summary>
 public SkinSurface GetSurface(SkinArea Rect, Point TargetSize)
 {
     return this.GetSurface(Rect, Rect.Width / 2, Rect.Height / 2, TargetSize);
 }
Exemple #2
0
        /// <summary>
        /// Gets a skin surface for the given region in the skin. The surface will be stretched at the stretch lines to get the target size.
        /// </summary>
        public SkinSurface GetSurface(SkinArea Rect, int XStretchLine, int YStretchLine, Point TargetSize)
        {
            List<SkinSurface.Stop> xstops = new List<SkinSurface.Stop>();
            List<SkinSurface.Stop> ystops = new List<SkinSurface.Stop>();
            xstops.Add(new SkinSurface.Stop(Rect.X, 0.0));
            if (TargetSize.X > Rect.Width)
            {
                xstops.Add(new SkinSurface.Stop(Rect.X + XStretchLine - 1, XStretchLine - 1));
                xstops.Add(new SkinSurface.Stop(Rect.X + XStretchLine + 1, TargetSize.X + XStretchLine - Rect.Width + 1));
            }
            xstops.Add(new SkinSurface.Stop(Rect.X + Rect.Width, TargetSize.X));

            ystops.Add(new SkinSurface.Stop(Rect.Y, 0.0));
            if (TargetSize.Y > Rect.Height)
            {
                ystops.Add(new SkinSurface.Stop(Rect.Y + YStretchLine - 1, YStretchLine - 1));
                ystops.Add(new SkinSurface.Stop(Rect.Y + YStretchLine + 1, TargetSize.Y + YStretchLine - Rect.Height + 1));
            }
            ystops.Add(new SkinSurface.Stop(Rect.Y + Rect.Height, TargetSize.Y));
            return this.GetSurface(xstops, ystops);
        }
Exemple #3
0
 /// <summary>
 /// Gets a skin surface for the given region in the skin. No stretching or resizing is applied to the surface.
 /// </summary>
 public SkinSurface GetSurface(SkinArea Rect)
 {
     List<SkinSurface.Stop> xstops = new List<SkinSurface.Stop>();
     List<SkinSurface.Stop> ystops = new List<SkinSurface.Stop>();
     xstops.Add(new SkinSurface.Stop(Rect.X, 0.0));
     xstops.Add(new SkinSurface.Stop(Rect.X + Rect.Width, Rect.Width));
     ystops.Add(new SkinSurface.Stop(Rect.Y, 0.0));
     ystops.Add(new SkinSurface.Stop(Rect.Y + Rect.Height, Rect.Height));
     return this.GetSurface(xstops, ystops);
 }