# Photo Cropping Wizard

DevFeed: [Photo Cropping Wizard](<https://devfeed.tech/articles/photo-cropping-wizard-19428.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/photo-cropping-wizard/>)

Author: Shai Almog

Published: 2019-05-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [ui](<https://devfeed.tech/topics/ui.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

A Codename One developer describes implementing a photo-cropping UI that lets users pan and zoom an image to choose the cropping area. The post builds on ImageViewer methods for producing cropped images and presents a more general-purpose component as a starting point.

## Source excerpt

A month ago Francesco asked how to implement the common image cropping UI we see in many applications where the user can pan and zoom to decide the cropping area. We implemented that feature by effectively enhancing the ImageViewer class with two new methods: public Image getCroppedImage(int backgroundColor); public Image getCroppedImage(int width, int height, int backgroundColor); But that's just the first step, implementing the whole UI is still not trivial. We'd like to add a more general purpose component that does that but doing this with an approach that's sufficiently generic is hard...