| Summary: | Support native scaling of the Images | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Gorkem Ercan <gorkem.ercan> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | eclipse.felipe, petru.motrescu, Silenio_Quarti |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Gorkem Ercan
What about this: Image imageSrc = new Image(display, fileName); Rectangle rect = imageSrc.getBounds(); Image imageDst = new Image(display, rect.width * 2, rect.height * 2); GC gc = new GC(imageDst); gc.drawImage(imageSrc, 0, 0, rect.width, rect.height, 0, 0,rect.width * 2, rect.height * 2); gc.dispose(); This will use native scalling. Does it work for you ? I would like us to have more control over the quality of the scale. With the GC solution, there is no such control. In S60, at least, the quality of the scale performed with the GC defaults to "low & quick" a.k.a. "nearest neighbour" scaling. With the new API addition we could hint (by declaring the param as hint we do not force all platform to conform) the desired scale quality & speed: - high & slow - nearest neighbour (quality param SWT.MAX ?) - medium - bilinear (quality param SWT.DEFAULT ?) - low & quick - bicubic (quality param SWT.MIN ?) The new API, I believe (personal opinion) is clearer and easier to find. You have this control in the current API already. Before drawing the image with the GC you need to call setAdvance(true) and setInterpolation() with one of the following: SWT.DEFAULT (Gdip.InterpolationModeDefault), SWT.NONE (Gdip.InterpolationModeNearestNeighbor), SWT.LOW (Gdip.InterpolationModeLowQuality), SWT.HIGH (Gdip.InterpolationModeHighQuality). Closing as works for me. Agreed ? I have failed to spot that. Thank you. |