Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Image


             // fill the background with background color (only if the background is not transparent)
            g.setColor(0x000000); //black
            g.fillRect(x,y,width,height);
        }

        final Image backgroundImage = this.getBackgroundImage();
        if ((backgroundImage != null) && (includeImage)) {
            if (this.isBackgroundImageTiled()) {
                // compute width/height stuff
                final int imageWidth = backgroundImage.getWidth();
                final int imageHeight = backgroundImage.getHeight();
                final int cx = width/imageWidth;
                final int cy  = height/imageHeight;
                //final int rx = width % imageWidth;
                //final int ry = width % imageHeight;
                System.out.println("CX = "+cx+"CY ="+cy);
View Full Code Here


        dismiss();
    }

    protected void paint( Graphics g )
    {
        Image image = Utilities.getSplashScreen();
        setFullScreenMode(true);
        Image thumbnail = Utilities.getAdjustedImage(image, getWidth(), getHeight());
        g.drawImage(thumbnail, 0, 0, 0);
    }
View Full Code Here

    }
    public static Image getAdjustedImage(Image image, int _width, int _height)
    {
        int srcWidth = image.getWidth();
  int srcHeight = image.getHeight();
  Image tmp = Image.createImage(_width, srcHeight);
  Graphics g = tmp.getGraphics();
  int ratio = (srcWidth << 16) / _height;
  int pos = ratio/2;

  //Horizontal Resize

  for (int x = 0; x < _width; x++)
        {
            g.setClip(x, 0, 1, srcHeight);
      g.drawImage(image, x - (pos >> 16), 0, Graphics.LEFT | Graphics.TOP);
            pos += ratio;
        }

   Image resizedImage = Image.createImage(_width, _height);
   g = resizedImage.getGraphics();
   ratio = (srcHeight << 16) / _height;
   pos = ratio/2;

   //Vertical resize
View Full Code Here

        {
                FileName = "0" + page;
        }
        FileName = "/quran_page_" + FileName + ".jpg";
       
        Image image = null;
        try
        {
            image = Image.createImage(FileName);
        }
        catch(Exception e)
View Full Code Here

        return image;
    }

    public static Image getSplashScreen()
    {
        Image image = null;
        try
        {
            image = Image.createImage("/quran.jpg");
        }
        catch(Exception e)
View Full Code Here

        if(getDraw() == false)
        {
            return;
        }
        Image image = Utilities.getImageFromPage(_pageNumber);
        Image thumbnail = Utilities.getAdjustedImage(image, _width, _height);
        g.drawImage(thumbnail, 0, 0, Graphics.TOP | Graphics.LEFT);

        setDraw(false);

    }
View Full Code Here

    itemsHeight = new int[itemLines.length];
   
    for(int i = 0; i < itemLines.length; i++)
    {
      // get image part of this item, if available
      Image imagePart = getImage(i);
     
      // get avaiable width for text
      int w = getItemWidth() - (imagePart != null ? imagePart.getWidth() + padding : 0);
     
      // and split item text into text rows, to fit available width
      itemLines[i] = getTextRows((String) items[i], font, w);
                        MainBridgelist.append(items[i], imagePart);
    }
View Full Code Here

    // loop List items
    for(int i = 0; i < itemLines.length; i++)
    {
      int itemRows = itemLines[i].length;
     
      Image imagePart = getImage(i);
     
      int itemHeight = itemRows * font.getHeight() + linePadding * (itemRows - 1);
     
      itemsTop[i] = top;
      itemsHeight[i] = itemHeight;
     
      // is image part higher than the text part?
      if(imagePart != null && imagePart.getHeight() > itemHeight)
      {
        itemHeight = imagePart.getHeight();
      }
      itemHeight += 2 * padding + 2 * borderWidth;
     
      g.translate(0, top);
     
      if(borderWidth > 0)
      {
        // paint item border
        g.setColor(i == selectedItem ? borderSelectedColor : borderColor);
        g.fillRect(margin, margin, getWidth() - 2 * margin, itemHeight);
      }
     
      // paint item background
      g.setColor(i == selectedItem ? backSelectedColor : backColor);
      g.fillRect(margin + borderWidth, margin + borderWidth, getWidth() - 2 * margin - 2 * borderWidth, itemHeight - 2 * borderWidth);
     
      // has this item an image part?
      if(imagePart != null)
      {
        g.drawImage(imagePart, margin + borderWidth + padding, margin + borderWidth + padding, Graphics.TOP | Graphics.LEFT);
      }
     
      // paint item text rows
      g.setColor(i == selectedItem ? foreSelectedColor : foreColor);
     
      int textLeft = margin + borderWidth + padding + (imagePart != null ? imagePart.getWidth() + padding : 0);
     
      for(int j = 0; j < itemRows; j++)
      {
        g.drawString(itemLines[i][j], textLeft, margin + borderWidth + padding + j * (linePadding + font.getHeight()), Graphics.TOP | Graphics.LEFT);
      }
View Full Code Here

public class ListRootFiles extends List {

  public ListRootFiles(String title){
    super(title, List.IMPLICIT);
    Enumeration drives = FileSystemRegistry.listRoots();
    Image driver = null;
    try {
      driver = Image.createImage("/drive-harddisk.png");
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of javax.microedition.lcdui.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.