Package javaforce.ui

Class Image

All Implemented Interfaces:
KeyCode, KeyEvents, MouseEvents

public class Image extends FontComponent
  • Field Details

  • Constructor Details

    • Image

      public Image()
    • Image

      public Image(int width, int height)
  • Method Details

    • setDefaultColor

      public static void setDefaultColor(int clr)
      Set background color used to fill new images (includes alpha value).
    • getDefaultColor

      public static int getDefaultColor()
      Get background color used to fill new images.
    • loadPNG

      public boolean loadPNG(InputStream is)
    • loadPNG

      public boolean loadPNG(String fn)
    • savePNG

      public boolean savePNG(OutputStream os)
    • savePNG

      public boolean savePNG(String fn)
    • loadJPG

      public boolean loadJPG(InputStream is)
    • loadJPG

      public boolean loadJPG(String fn)
    • saveJPG

      public boolean saveJPG(OutputStream os)
    • saveJPG

      public boolean saveJPG(String fn)
    • loadBMP

      public boolean loadBMP(String filename, int index)
    • saveBMP

      public boolean saveBMP(String filename)
    • loadBMP

      public boolean loadBMP(InputStream in, int index)
    • saveBMP

      public boolean saveBMP(OutputStream out)
    • saveICO

      public boolean saveICO(String filename)
    • saveICO

      public boolean saveICO(OutputStream out)
    • saveICNS

      public boolean saveICNS(String filename)
      save icns (Mac icon)
    • saveICNS

      public boolean saveICNS(OutputStream out)
      save icns (Mac icon)
    • loadSVG

      public boolean loadSVG(String filename)
    • saveSVG

      public boolean saveSVG(String filename)
    • loadSVG

      public boolean loadSVG(InputStream in)
    • saveSVG

      public boolean saveSVG(OutputStream out)
    • loadXPM

      public boolean loadXPM(String filename)
    • loadXPM

      public boolean loadXPM(InputStream in)
    • setSize

      public void setSize(int width, int height)
      Overrides:
      setSize in class Component
    • getResizeOperation

      public int getResizeOperation()
    • setResizeOperation

      public void setResizeOperation(int op)
    • getPixel

      public int getPixel(int x, int y)
    • putPixel

      public void putPixel(int x, int y, int c)
    • getPixelA

      public int getPixelA(int x, int y)
    • putPixelA

      public void putPixelA(int x, int y, int c)
    • getPixels

      public int[] getPixels()
      Returns a copy of the pixels buffer.
    • getBuffer

      public int[] getBuffer()
      Returns the pixels buffer.
    • putPixels

      public void putPixels(int[] src, int x, int y, int w, int h, int srcOffset)
      Puts pixels.
    • putPixels

      public void putPixels(int[] src, int x, int y, int w, int h, int srcOffset, int srcWidth)
      Puts pixels (supports padding at end of each scan line)
    • putPixelsKeyClr

      public void putPixelsKeyClr(int[] px, int x, int y, int w, int h, int offset, int keyclr)
      Put Pixels unless src pixel == keyclr
    • putPixelsBlend

      public void putPixelsBlend(int[] px, int x, int y, int w, int h, int srcOffset, int srcWidth, boolean keepAlpha)
      Puts pixels blending using src alpha (dest alpha is ignored). if keepAlpha is true then dest alpha is preserved. if keepAlpha is false then src alpha is copied to dest.
    • putPixelsBlendKeyClr

      public void putPixelsBlendKeyClr(int[] px, int x, int y, int w, int h, int srcOffset, int srcWidth, boolean keepAlpha, int keyclr)
      Puts pixels blending using src alpha (dest alpha is ignored) unless src pixel == keyclr. if keepAlpha is true then dest alpha is preserved. if keepAlpha is false then src alpha is copied to dest.
    • putPixelsStencil

      public void putPixelsStencil(int[] px, int x, int y, int w, int h, int srcOffset, int srcWidth, boolean keepAlpha, int clr)
      Puts pixels using src as a stencil.
    • fill

      public void fill(int x, int y, int w, int h, int clr)
      Fills a rectangle with clr
    • fill

      public void fill(int x, int y, int w, int h, int clr, boolean hasAlpha)
      Fills a rectangle with clr
    • fill

      public void fill(int x, int y, int w, int h)
      Fills a rectangle with current fore color.
    • drawText

      public void drawText(int x, int y, String txt)
    • drawPixel

      public void drawPixel(int x, int y)
    • setLineStyle

      public void setLineStyle(int style)
    • drawLine

      public void drawLine(int x1, int y1, int x2, int y2)
    • drawBox

      public void drawBox(int x, int y, int width, int height)
    • drawImage

      public void drawImage(Image img, int x, int y)
    • drawImageKeyClr

      public void drawImageKeyClr(Image img, int x, int y, int keyclr)
    • drawImageBlend

      public void drawImageBlend(Image img, int x, int y, boolean keepAlpha)