public void SetScaleCenter(double tsx, double tsy) { if (tsx < 0.1) { return; } if (tsy < 0.1) { return; } pf_UpdateMatrix(delegate(Matrix tmtr) { double tysx = RxGeom.GetScaleX(tmtr); double tysy = RxGeom.GetScaleY(tmtr); double tnsx = RxGeom.DoubleRound(tsx); double tnsy = RxGeom.DoubleRound(tsy); if ((tysx != tnsx) && (tysy != tnsy)) { double tcx = RxGeom.GetLeftCenter(_rctBounds); double tcy = RxGeom.GetTopCenter(_rctBounds); tmtr.Translate(-tcx, -tcy); double tbsx = 1 / tysx; double tbsy = 1 / tysy; tmtr.Scale(tbsx, tbsy); tmtr.Scale(tnsx, tnsy); tmtr.Translate(tcx, tcy); } return(tmtr); }); }
private void pf_ImageWidthUpdate() { Rect rctArea = new Rect(new Point(0, 0), _rxivc.RenderSize); Rect rctImg = _rxivc.GetImageBounds(); double tmw = rctArea.Width; double tiw = rctImg.Width; double tssrw = tmw / tiw; _rxsbHori.ScrollSizeRatio = tssrw; if (tssrw < 1) { double tssw = tiw - tmw; double tprw = _rxsbHori.PositionRatio; double tix = rctArea.Left - (tssw * tprw); _rxivc.MoveLeft(tix); _rxivc.BoundsDrawUpdate(); } else { double tmx = RxGeom.GetLeftCenter(rctArea); _rxivc.MoveLeftCenter(tmx); _rxivc.BoundsDrawUpdate(); } }
public void MoveLeftCenter(double tv) { pf_UpdateMatrix(delegate(Matrix tmtr) { double ttx = tv - RxGeom.GetLeftCenter(_rctBounds); double tty = 0; tmtr.Translate(ttx, tty); return(tmtr); }); }
public void MoveCenter(double tmx, double tmy) { pf_UpdateMatrix(delegate(Matrix tmtr) { double tcx = RxGeom.GetLeftCenter(_rctBounds); double tcy = RxGeom.GetTopCenter(_rctBounds); double ttx = tmx - tcx; double tty = tmy - tcy; tmtr.Translate(ttx, tty); return(tmtr); }); }
public void SetRotateCenter(double trd) { pf_UpdateMatrix(delegate(Matrix tmtr) { double tyrd = RxGeom.GetRadian1(tmtr); double tnrd = RxGeom.CheckRadian(trd); if (tnrd != tyrd) { double tcx = RxGeom.GetLeftCenter(_rctBounds); double tcy = RxGeom.GetTopCenter(_rctBounds); tmtr.Translate(-tcx, -tcy); tmtr.Rotate(-RxGeom.GetRadianToAngle(tyrd)); tmtr.Rotate(RxGeom.GetRadianToAngle(tnrd)); tmtr.Translate(tcx, tcy); } return(tmtr); }); }
public double GetLeftCenter() { return(RxGeom.GetLeftCenter(_rctBounds)); }