-
Notifications
You must be signed in to change notification settings - Fork 190
Snippet for demonstrating Cropping and Scaling of GC#drawImage #2912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snippet for demonstrating Cropping and Scaling of GC#drawImage #2912
Conversation
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet388.java
Outdated
Show resolved
Hide resolved
5a92e80 to
ebd2b7b
Compare
akoch-yatta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it looks good to me.
I need to test a bit more, but the Screenshot of the snippet and the entry in Snippets.md is missing, have a look e.g. in cf6ee39 to see, what is necessary for a new Snippet
ebd2b7b to
51500ee
Compare
|
A preview screenshot and an entry in the snippets.md file are now included. |
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet389.java
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet389.java
Show resolved
Hide resolved
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the name of the folder containing the images is currently "Snippet388" whereas the snippet number is 389.
fca7ccd to
57ed4f8
Compare
57ed4f8 to
843b0b6
Compare
Previously, GC#drawImage was only used in Snippet 10 to demonstrate scaling. Since the method also supports cropping parts of a source image, and scaling itself can be achieved by passing only the destination coordinates/width/height, this commit adds a more expressive snippet.
843b0b6 to
b887982
Compare
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snippet looks fine. I would like to merge it soon as it currently kind of blocks #2926, which introduces subsequent Snippet390. @akoch-yatta do you have any concerns? In case we find some need to improve the snippet afterwards, we can still adapt.
With the latest changes, I just fixed the following:
- Formatting of the Java file
- Wrong path to images (still contained "Snippet388", so snippet did not start)
- Replaced the preview image with one taken at 100% monitor zoom as the previous one was too large for the SnippetExplorer
- Removed faulty issue reference from commit message
|
I'm fine with merging it, my original remarks were solved |
|
Adding the snippet to the SWT website via: |
Previously, GC#drawImage was only used in Snippet 10 to demonstrate scaling. Since the method also supports cropping parts of a source image, and scaling itself can be achieved by passing only the destination coordinates/width/height, this PR adds a more expressive snippet.