How do I resize an imageview image in javafx?

I need to resize an image to specific dimensions, 100 by 100 pixels for example, in JavaFX. How can I achieve that? Could the Image or the ImageView class be used for this purpose? Answer Yes, using an ImageView. Just call ImageView imageView = new ImageView(“…”); imageView.setFitHeight(100); imageView.setFitWidth(100); By default, it will not preserve the … Read more

How to smooth ugly jitter/flicker/jumping when resizing windows, especially dragging left/top border (Win 7-10; bg, bitblt and DWM)?

THE PROBLEM: When I grab the resize border of my Windows app, especially the top or left borders, and resize the window, the contents of the window do resize “live” as I drag, but they resize in a hideous manner that looks like a blatant bug to even the most novice user: the contents at … Read more

UICollectionView – resizing cells on device rotate – Swift

I’ve created a UICollectionView, so that I can arrange views into neat columns. I’d like there to be a single column on devices > 500 pixels wide. In order to achieve this, I created this function: func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { let size = collectionView.frame.width if (size > … Read more

Canvas drawImage scaling

I’m trying to scale an image proportionately to the canvas. I’m able to scale it with fixed width and height as so: context.drawImage(imageObj, 0, 0, 100, 100) But I only want to resize the width and have the height resize proportionately. Something like the following: context.drawImage(imageObj, 0, 0, 100, auto) I’ve looked everywhere I can … Read more