Changeset 1102 for trunk/src/org/expeditee/items/FrameBitmap.java
- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/FrameBitmap.java
r919 r1102 19 19 package org.expeditee.items; 20 20 21 import java.awt.Color;22 import java.awt.Image;23 import java.awt.image.BufferedImage;24 import java.awt.image.ImageObserver;25 21 import java.util.List; 26 22 23 import org.expeditee.core.Colour; 24 import org.expeditee.core.Image; 27 25 import org.expeditee.gui.Frame; 28 26 import org.expeditee.gui.FrameIO; … … 31 29 32 30 public class FrameBitmap extends FramePicture { 33 public FrameBitmap(Text source, Image Observer observer, Imageimage){34 super(source, observer,image);31 public FrameBitmap(Text source, Image image){ 32 super(source, image); 35 33 } 36 34 … … 59 57 return false; 60 58 61 BufferedImage bi = new BufferedImage(width, height, 62 BufferedImage.TYPE_INT_ARGB); 59 Image bi = Image.createImage(width, height); 63 60 // now set the bits on the image 64 final int transparent = (new Colo r(0F, 0F, 0F, 0F)).getRGB();65 final int main = _source.getPaintColor().get RGB();66 final Colo r c = _source.getPaintColor();61 final int transparent = (new Colour(0F, 0F, 0F, 0F)).getARGB32BitPacked(); 62 final int main = _source.getPaintColor().getARGB32BitPacked(); 63 final Colour c = _source.getPaintColor(); 67 64 int currentColor = main; 68 65 int row = 0; … … 74 71 // Space is transparent as is 0 75 72 if (Character.isDigit(currentPixel)) { 76 int alpha = Math.round((currentPixel - '0') * 25.5F);77 currentColor = new Colo r(c.getRed(), c.getGreen(), c78 .getBlue(), alpha).get RGB();73 int alpha = Math.round((currentPixel - '0') * (Colour.COMPONENT_MAX_VALUE / 10.0f)); 74 currentColor = new Colour(c.getRed(), c.getGreen(), c 75 .getBlue(), alpha).getARGB32BitPacked(); 79 76 }else if (currentPixel != ' ') { 80 77 currentColor = main; 81 78 } 82 79 } 83 bi.set RGB(i, row, currentColor);80 bi.setPixel(i, row, Colour.fromARGB32BitPacked(currentColor)); 84 81 } 85 82 row++; … … 92 89 @Override 93 90 protected Picture createPicture() { 94 return new FrameBitmap((Text) _source.copy(), 95 _imageObserver, _image); 91 return new FrameBitmap((Text) _source.copy(), _image); 96 92 } 97 93
Note:
See TracChangeset
for help on using the changeset viewer.