-
Notifications
You must be signed in to change notification settings - Fork 182
GC#DrawImage(image, destX, destY, destWidth, destHeight) now tries to load images at the requested destination size before drawing #2526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
akoch-yatta
merged 1 commit into
eclipse-platform:master
from
vi-eclipse:arunjose696/326/imageAtSizeProvider
Oct 1, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
.../org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataAtSizeProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 Vector Informatik GmbH and others. | ||
* | ||
* This program and the accompanying materials 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/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Michael Bangas (Vector Informatik GmbH) - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.swt.graphics; | ||
|
||
/** | ||
* Provides an API that is invoked by SWT when an image needs to be drawn at a | ||
* specified width and height. | ||
* <p> | ||
* Client code must implement this interface to supply {@link ImageData} on demand. | ||
* </p> | ||
* | ||
* @since 3.132 | ||
* @noreference This class is still experimental API and might be subject to change. | ||
*/ | ||
public interface ImageDataAtSizeProvider extends ImageDataProvider { | ||
|
||
/** | ||
* Returns the {@link ImageData} for the given width and height. | ||
* | ||
* <p> | ||
* <b>Implementation notes:</b> | ||
* </p> | ||
* <ul> | ||
* <li>Returning <code>null</code> is not permitted. If <code>null</code> is | ||
* returned, SWT will throw an exception when loading the image.</li> | ||
* <li>The returned {@link ImageData} must match the requested width and height | ||
* exactly. Implementations should ensure proper resizing and scaling of the | ||
* image based on the height and width requested</li> | ||
* </ul> | ||
* | ||
* @param width the desired width of the {@link ImageData} to be returned | ||
* @param height the desired height of the {@link ImageData} to be returned | ||
* @return the {@link ImageData} that exactly matches the requested width and | ||
* height | ||
* @since 3.132 | ||
*/ | ||
ImageData getImageData(int width, int height); | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.