Skip to content

Commit d2a5a59

Browse files
committed
Update N&N on new API for drawing scaled images
- Fixes wrongly formatted contributors - Adds missing contributors - Improves title - Improves formatting - Removes statement on not-yet-released API
1 parent d82fdd6 commit d2a5a59

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

news/4.38/platform_isv.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ A special thanks to everyone who [contributed to Eclipse-Platform](acknowledgeme
99

1010
## SWT Changes
1111

12-
### New API: `GC#drawImage(Image image, int destX, int destY, int destWidth, int destHeight)`
12+
### New GC API for Drawing Scaled Images
1313

1414
<details>
15-
<summary>Contributors</summary>
16-
17-
- [Arun Jose](https://github.com/arunjose696)
15+
<summary>Contributors</summary>
16+
17+
- [Arun Jose ](https://github.com/arunjose696)
18+
- [Heiko Klare ](https://github.com/HeikoKlare)
19+
- [Michael Bangas ](https://github.com/Michael5601)
1820
</details>
1921

2022
#### Description
21-
A new `drawImage` method in `GC` allows drawing the **full image** into a specified destination rectangle.
22-
Until now, the existing method
23-
`drawImage(image, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight)`
24-
was used for this purpose by specifying the full source bounds. The new method simplifies the process by eliminating the need to provide the actual image bounds when drawing the entire image.
23+
A new `drawImage` method in `GC` allows drawing the **full image** into a specified destination rectangle:
24+
```java
25+
GC#drawImage(image, destX, destY, destWidth, destHeight)
26+
```
27+
Until now, the existing method `drawImage(image, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight)` was used for this purpose by specifying the full source bounds. The new method simplifies the process by eliminating the need to provide the actual image bounds when drawing the entire image.
2528

2629
#### New vs. Existing Method
2730
- **Existing method:** Handles scaling and cropping; requires explicit source bounds. Best suited for drawing a cropped part of the image. However, this is not a very common use case in Eclipse products, as images are mostly drawn at their full sizes.
@@ -37,7 +40,7 @@ gc.drawImage(image, 0, 0, 200, 100);
3740
```
3841

3942
#### Additional Note
40-
When using the new `drawImage` method, images that can provide size-specific data (such as SVGs or images backed by `ImageDataAtSizeProvider`) are loaded at the destination size, avoiding blurry scaling.
43+
When using the new `drawImage` method, images that can provide size-specific data (such as SVGs) are loaded at the destination size, avoiding blurry scaling.
4144
For all other images the behavior remains the same as before _i.e._ they are loaded at the closest available zoom level.
4245
This destination-size loading is currently only available in the new method but may be added to the existing method in the future.
4346

0 commit comments

Comments
 (0)