×

Discussion Board

Results 1 to 4 of 4

Thread: Canvas Color

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    37

    Canvas Color

    Hi,
    How can I change the Canvas color?
    thanks

    eml

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Helsinki.FI
    Posts
    112
    eml,

    I guess you are talking about the background color. There is really no other way doing it than:

    public void paint(Graphics g) {
    g.setColor(0, 0, 0); // or whatever background color you wish
    g.fillRect(0, 0, getWidth(), getHeight());
    // the rest of the paint() method implementation follows
    }

    Kind regards,
    Tinke / FN

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    37
    yes I was talking about the canvas background color.

    thanks to your reply.

  4. #4
    Registered User
    Join Date
    Apr 2003
    Location
    Russia
    Posts
    34
    hi, Canvas dont have background color. Draw fill rect first at paint method.
    see tinkezione sample

Posting Permissions

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