public void Normalize(Size parentSize) { Rectangle rect = Rectangle.Intersect(new Rectangle(Offset, SrcRectangle.Size), new Rectangle(new Point(), parentSize)); if (rect.IsEmpty) { BaseImage = null; return; } Offset.X = rect.X; Offset.Y = rect.Y; SrcRectangle.Width = rect.Width; SrcRectangle.Height = rect.Height; }
internal bool AddFrame(AbstractImage parentImage, Rectangle rect, Point pos, int delay) { AnimeFrame frame = new AnimeFrame(); frame.index = FrameList.Count; frame.BaseImage = parentImage; frame.SrcRectangle = rect; frame.Offset = pos; if (delay <= 0) { delay = 1; } frame.DelayTimeMs = delay; frame.Normalize(DestBaseSize); totaltime += delay; FrameList.Add(frame); return(true); }
public ASpriteSingle(string name, AbstractImage img, Rectangle rect) : base(name, rect.Size) { SrcRectangle = rect; BaseImage = img; }
public void Dispose() { BaseImage = null; }
public override void Dispose() { BaseImage = null; }