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.

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 5a92e80 to ebd2b7b Compare December 26, 2025 11:04
@github-actions
Copy link
Contributor

Test Results

  173 files   -  3    173 suites   - 3   22m 24s ⏱️ - 4m 53s
4 671 tests  -  1  4 648 ✅  -  2  23 💤 +1  0 ❌ ±0 
  464 runs   - 18    459 ✅  - 17   5 💤  - 1  0 ❌ ±0 

Results for commit ebd2b7b. ± Comparison against base commit 47e2587.

This pull request removes 1 test.
org.eclipse.swt.tests.gtk.snippets.Bug336238_ShellSetBoundFailTest ‑ testSetBounds
This pull request skips 1 test.
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Shell ‑ test_activateEventSend

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

2 participants