Skip to content

Conversation

@al-noori
Copy link
Contributor

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 (adresses #565).

* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
* Copyright (c) 2000, 2016 IBM Corporation and others.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this was (mostly) copied, but even then the date does not reflect date of current content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, the header was copied from an existing snippet.
I’ve updated the copyright year to reflect the current content.

@al-noori al-noori force-pushed the al-noori/SnippetForDrawImage branch 2 times, most recently from 5a92e80 to ebd2b7b Compare December 26, 2025 11:04
@github-actions
Copy link
Contributor

github-actions bot commented Dec 26, 2025

Test Results

  176 files  ±0    176 suites  ±0   26m 38s ⏱️ +24s
4 672 tests ±0  4 650 ✅ ±0  22 💤 ±0  0 ❌ ±0 
  482 runs  ±0    476 ✅ ±0   6 💤 ±0  0 ❌ ±0 

Results for commit 51500ee. ± Comparison against base commit 383ed2a.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@akoch-yatta akoch-yatta left a 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

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 (adresses eclipse-platform#565).
@al-noori al-noori force-pushed the al-noori/SnippetForDrawImage branch from ebd2b7b to 51500ee Compare January 2, 2026 14:30
@al-noori
Copy link
Contributor Author

al-noori commented Jan 2, 2026

A preview screenshot and an entry in the snippets.md file are now included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make a Snippet for Cropping + Scaling of GC#drawImage

3 participants