You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
19
+
20
+
#### New vs. Existing Method
21
+
-**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.
22
+
-**New method:** Handles scaling and drawing the full image more efficently, as consumers do not need to call `getBounds()` to calculate the image size. Recommended for scenarios where cropping is unnecessary.
// New method: simpler, only need to provide destination cordinates
30
+
gc.drawImage(image, 0, 0, 200, 100);
31
+
```
32
+
33
+
#### Additional Note
34
+
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.
35
+
For all other images the behavior remains the same as before _i.e._ they are loaded at the closest available zoom level.
36
+
This destination-size loading is currently only available in the new method but may be added to the existing method in the future.
0 commit comments