Revision: 2970
http://sourceforge.net/p/swingme/code/2970
Author: yuranet
Date: 2025-12-13 12:22:31 +0000 (Sat, 13 Dec 2025)
Log Message:
-----------
put more on the draw offscreen image
Modified Paths:
--------------
SwingMETest/src/net/yura/mobile/test/GraphicsTest.java
SwingMETest/src/net/yura/mobile/test/MainTest.java
Modified: SwingMETest/src/net/yura/mobile/test/GraphicsTest.java
===================================================================
--- SwingMETest/src/net/yura/mobile/test/GraphicsTest.java 2025-12-13 03:09:48 UTC (rev 2969)
+++ SwingMETest/src/net/yura/mobile/test/GraphicsTest.java 2025-12-13 12:22:31 UTC (rev 2970)
@@ -93,8 +93,6 @@
Graphics g = img.getGraphics();
g.drawImage(mainPane.image.getImage(), 5, 5, 0);
- g.setColor(0xFFFF0000); // red
- g.drawLine(0, 0, 50, 50);
g.setColor(0xFF00FF00); // green
g.fillRoundRect(1,1, 48, 48, 5, 5);
@@ -102,6 +100,33 @@
g.setColor(0xFF0000FF); // blue
g.fillArc(1, 1, 48, 48, 0, 360);
+ g.setColor(0xFFFF0000); // red
+ g.drawLine(0, 0, 50, 50);
+
+ int[] rgb = new int[img.getWidth() * img.getHeight()];
+ img.getRGB(rgb, 0, img.getWidth(), 0, 0, img.getWidth(), img.getHeight());
+
+ for (int a = 0; a < 15 * img.getWidth(); a++) {
+ int x = a % img.getWidth();
+ int y = a / img.getWidth();
+ int newColor;
+ int alpha = (int)(((img.getWidth()-x) / (double)img.getWidth()) * 255) << 24;
+ if (y < 5) {
+ newColor = 0x00FF0000 | alpha;
+ }
+ else if (y < 10) {
+ newColor = 0x0000FF00 | alpha;
+ }
+ else {
+ newColor = 0x000000FF | alpha;
+ }
+
+ rgb[a + 17 * img.getWidth()] = newColor;
+ }
+
+ img = Image.createRGBImage(rgb, img.getWidth(), img.getHeight(), true);
+ rgb = null;
+
// test saving file to disk
try {
//OutputStream out=FileUtil.getWriteFileConnection("file:///root1/img.jpg").openOutputStream();
Modified: SwingMETest/src/net/yura/mobile/test/MainTest.java
===================================================================
--- SwingMETest/src/net/yura/mobile/test/MainTest.java 2025-12-13 03:09:48 UTC (rev 2969)
+++ SwingMETest/src/net/yura/mobile/test/MainTest.java 2025-12-13 12:22:31 UTC (rev 2970)
@@ -714,7 +714,7 @@
synth = new SynthLookAndFeel() {
- @Override
+
protected Image createImage(String path) {
return super.createImage(dir+size+path);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|