internal TexturePaintContext(ColorModel cm, AffineTransform xform, int bWidth, int bHeight, int maxw) { this.ColorModel_Renamed = GetInternedColorModel(cm); this.BWidth = bWidth; this.BHeight = bHeight; this.MaxWidth = maxw; try { xform = xform.CreateInverse(); } catch (NoninvertibleTransformException) { xform.SetToScale(0, 0); } this.IncXAcross = Mod(xform.ScaleX, bWidth); this.IncYAcross = Mod(xform.ShearY, bHeight); this.IncXDown = Mod(xform.ShearX, bWidth); this.IncYDown = Mod(xform.ScaleY, bHeight); this.XOrg = xform.TranslateX; this.YOrg = xform.TranslateY; this.Colincx = (int)IncXAcross; this.Colincy = (int)IncYAcross; this.Colincxerr = FractAsInt(IncXAcross); this.Colincyerr = FractAsInt(IncYAcross); this.Rowincx = (int)IncXDown; this.Rowincy = (int)IncYDown; this.Rowincxerr = FractAsInt(IncXDown); this.Rowincyerr = FractAsInt(IncYDown); }
public static AffineTransform GetScaleInstance(float scx, float scY) { var t = new AffineTransform(); t.SetToScale(scx, scY); return(t); }