[Pixelle-commit] SF.net SVN: pixelle: [127] trunk/pixelle/src/com/mebigfatguy/pixelle/ PixelleImage
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-06-30 01:55:36
|
Revision: 127
http://pixelle.svn.sourceforge.net/pixelle/?rev=127&view=rev
Author: dbrosius
Date: 2008-06-29 18:55:46 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
fix selection drawing
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-29 22:22:36 UTC (rev 126)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-30 01:55:46 UTC (rev 127)
@@ -39,9 +39,6 @@
public PixelleImage() {
this(new BufferedImage(400, 400, BufferedImage.TYPE_3BYTE_BGR));
- Graphics g = image.getGraphics();
- g.setColor(Color.RED);
- g.fillRect(0, 0, 400, 400);
}
public PixelleImage(BufferedImage img) {
@@ -51,7 +48,7 @@
byte[] alpha = new byte[] {0, -1};
IndexColorModel model = new IndexColorModel(1, 2, wb, wb, wb, alpha);
selection = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY, model);
- composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f);
+ composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f);
Graphics g = selection.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
@@ -74,13 +71,13 @@
}
public void draw(Graphics g, int left, int top, int width, int height) {
- g.drawImage(image, left, top, width, height, Color.WHITE, null);
+ g.drawImage(image, left, top, width, height, null);
if (g instanceof Graphics2D) {
Graphics2D g2d = (Graphics2D)g;
Composite saveComposite = g2d.getComposite();
try {
g2d.setComposite(composite);
- g.drawImage(selection, left, top, width, height, Color.WHITE, null);
+ g.drawImage(selection, left, top, width, height, null);
} finally {
g2d.setComposite(saveComposite);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|