1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

New splashscreen and about images

This commit is contained in:
Federico Fissore
2015-03-17 10:49:16 +01:00
parent f7eb24815c
commit ec1db8ca8a
6 changed files with 20 additions and 20 deletions

View File

@ -1516,29 +1516,30 @@ public class Base {
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public void handleAbout() { public void handleAbout() {
final Image image = getLibImage("about.jpg", activeEditor); final Image image = getLibImage("about.png", activeEditor);
final Window window = new Window(activeEditor) { final Window window = new Window(activeEditor) {
public void paint(Graphics g) { public void paint(Graphics g) {
g.drawImage(image, 0, 0, null); g.drawImage(image, 0, 0, null);
Graphics2D g2 = (Graphics2D) g; Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
g.setFont(new Font("SansSerif", Font.PLAIN, 11)); g.setFont(new Font("SansSerif", Font.PLAIN, 11));
g.setColor(Color.white); g.setColor(Color.white);
g.drawString(BaseNoGui.VERSION_NAME, 50, 30); g.drawString(BaseNoGui.VERSION_NAME, 33, 20);
} }
}; };
window.addMouseListener(new MouseAdapter() { window.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
window.dispose(); window.dispose();
} }
}); });
int w = image.getWidth(activeEditor); int w = image.getWidth(activeEditor);
int h = image.getHeight(activeEditor); int h = image.getHeight(activeEditor);
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
window.setBounds((screen.width-w)/2, (screen.height-h)/2, w, h); window.setBounds((screen.width - w) / 2, (screen.height - h) / 2, w, h);
window.setLocationRelativeTo(activeEditor);
window.setVisible(true); window.setVisible(true);
} }
@ -2173,11 +2174,10 @@ public class Base {
* Return an Image object from inside the Processing lib folder. * Return an Image object from inside the Processing lib folder.
*/ */
static public Image getLibImage(String name, Component who) { static public Image getLibImage(String name, Component who) {
Image image = null;
Toolkit tk = Toolkit.getDefaultToolkit(); Toolkit tk = Toolkit.getDefaultToolkit();
File imageLocation = new File(getContentFile("lib"), name); File imageLocation = new File(getContentFile("lib"), name);
image = tk.getImage(imageLocation.getAbsolutePath()); Image image = tk.getImage(imageLocation.getAbsolutePath());
MediaTracker tracker = new MediaTracker(who); MediaTracker tracker = new MediaTracker(who);
tracker.addImage(image, 0); tracker.addImage(image, 0);
try { try {

View File

@ -853,11 +853,11 @@
<copy todir="windows/work"> <copy todir="windows/work">
<fileset dir="windows/launcher" <fileset dir="windows/launcher"
includes="about.bmp, application.ico, config.xml, config_debug.xml, arduino.l4j.ini"/> includes="application.ico, config.xml, config_debug.xml, arduino.l4j.ini"/>
</copy> </copy>
<launch4j configFile="windows/work/config.xml" /> <launch4j configFile="windows/work/config.xml" />
<launch4j configFile="windows/work/config_debug.xml" /> <launch4j configFile="windows/work/config_debug.xml" />
<delete dir="windows/work" includes="about.bmp, application.ico, config.xml, config_debug.xml" /> <delete dir="windows/work" includes="application.ico, config.xml, config_debug.xml" />
<copy file="windows/work/arduino.l4j.ini" tofile="windows/work/arduino_debug.l4j.ini" /> <copy file="windows/work/arduino.l4j.ini" tofile="windows/work/arduino_debug.l4j.ini" />
<!-- cygwin requires html, dll, and exe to have the +x flag --> <!-- cygwin requires html, dll, and exe to have the +x flag -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

BIN
build/shared/lib/about.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 KiB