×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    9

    fillTriangle on Nokia 3510i

    Hi all.
    I was trying use fillTriangle method in simply code for Nokia 3510i.

    import javax.microedition.lcdui.*;
    import com.nokia.mid.ui.*;

    public class gcanvas extends FullCanvas
    {
    private gmidlet midlet;
    private int width,height;

    public gcanvas(gmidlet midlet)
    {
    this.midlet=midlet;
    width=getWidth();
    height=getHeight();
    }

    public void paint(Graphics g)
    {
    g.setColor(32,32,32);
    g.fillRect(0,0,width,height);
    DirectGraphics dg = DirectUtils.getDirectGraphics(g);
    dg.fillTriangle(0,0,20,50,80,50,0xffffff);
    }


    public void keyPressed(int keyCode)
    {
    if(keyCode<0)
    midlet.exit();
    }
    }


    But don’t work. There is only black screen.
    Have I some error’s there ?

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    9

    no problem :)

    Hi all.
    Here is problem solution.

    High-order byte specifies opacity;
    that is, 0x00RRGGBB specifies a fully transparent pixel and 0xFFRRGGBB specifies a fully opaque pixel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×