Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 284561 Details for
Bug 568234
[linux][gtk3] support scaled image instances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
image snippet
Snippet355.txt (text/plain), 1.78 KB, created by
Sravan Kumar Lakkimsetti
on 2020-10-26 03:37:00 EDT
(
hide
)
Description:
image snippet
Filename:
MIME Type:
Creator:
Sravan Kumar Lakkimsetti
Created:
2020-10-26 03:37:00 EDT
Size:
1.78 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2016 IBM Corporation and others. > * > * This Example Content is intended to demonstrate > * usage of Eclipse technology. It is provided to you under the terms and > * conditions of the Eclipse Distribution License v1.0 which is available > * at http://www.eclipse.org/org/documents/edl-v10.php > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.swt.snippets; > >/* > * draw an image scaled to half size and double size > * > * For a list of all SWT example snippets see > * http://www.eclipse.org/swt/snippets/ > */ >import org.eclipse.swt.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.widgets.*; > >public class Snippet355 { > public static void main (String [] args) { > Display display = new Display (); > Shell shell = new Shell (display, SWT.SHELL_TRIM | SWT.DOUBLE_BUFFERED); > shell.setText("Snippet 355"); > final Image image = new Image(display,"/home/sravan/Downloads/1549492770.svg"); > shell.addListener (SWT.Paint, e -> { > Rectangle rect = image.getBounds (); > int width = rect.width; > int height = rect.height; > GC gc = e.gc; > int x = 10, y = 10; > gc.drawImage (image, 0, 0, width, height, x, y, width, height); > gc.drawImage (image, 0, 0, width, height, x+width, y, (int)Math.round(width * 0.5), (int)Math.round(height * 0.5)); > gc.drawImage (image, 0, 0, width, height, x+width+(int)Math.round(width * 0.5), y, width * 2, height * 2); > }); > shell.setSize (600, 400); > shell.open (); > while (!shell.isDisposed ()) { > if (!display.readAndDispatch ()) > display.sleep (); > } > display.dispose (); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 568234
: 284561