JavaFX correct scaling

I created a sample app to demonstrate one approach to performing scaling of a node in a viewport on a scroll event (e.g. scroll in and out by rolling the mouse wheel). The key logic to the sample for scaling a group placed within a StackPane: final double SCALE_DELTA = 1.1; final StackPane zoomPane = … Read more

How to capture UIView to UIImage without loss of quality on retina display

Switch from use of UIGraphicsBeginImageContext to UIGraphicsBeginImageContextWithOptions (as documented on this page). Pass 0.0 for scale (the third argument) and you’ll get a context with a scale factor equal to that of the screen. UIGraphicsBeginImageContext uses a fixed scale factor of 1.0, so you’re actually getting exactly the same image on an iPhone 4 as … Read more

Android ImageView Scaling and translating issue

this is a working example of two fingers move/scale/rotate (note: the code is quite short due to smart detector used – see MatrixGestureDetector): class ViewPort extends View { List<Layer> layers = new LinkedList<Layer>(); int[] ids = {R.drawable.layer0, R.drawable.layer1, R.drawable.layer2}; public ViewPort(Context context) { super(context); Resources res = getResources(); for (int i = 0; i < … Read more