protected void paintBackground(Graphics g) {
    // paint my bubble
    int col = g.getColor();

    int height = this.getContentHeight();
    // int width = this.getContentWidth();
    int width = this.getWidth();

    // draw corners
    g.drawBitmap(0, 0, 17, 17, blue_bubble, 0, 0); // left top
    g.drawBitmap(width - 11, 0, 10, 10, blue_bubble, 36, 0); // right top
    g.drawBitmap(0, height - 11, 17, 11, blue_bubble, 0, 17); // left bottom
    g.drawBitmap(width - 11, height - 11, 11, 11, blue_bubble, 36, 17); // right bottom
    // draw borders
    g.tileRop(Graphics.ROP_SRC_ALPHA, 17, 0, width - 27, 9, blue_top_bar, 0, 0);
    g.tileRop(Graphics.ROP_SRC_ALPHA, 7, 17, 10, height - 28, blue_left_bar, 0, 0);
    g.tileRop(Graphics.ROP_SRC_ALPHA, 17, height - 11, width - 27, 11, blue_bottom_bar, 0, 0);
    g.tileRop(Graphics.ROP_SRC_ALPHA, width - 15, 10, 9, height - 21, blue_right_bar, 0, 0);

    // draw inside bubble
    // g.tileRop(Graphics.ROP_SRC_ALPHA, 17, 10, width-27, height-19, grey_inside_bubble, 0, 0);
    g.setColor(0x00FAFAFA);
    g.fillRect(17, 9, width - 28, height - 19);

    g.setColor(col);
    super.paintBackground(g);
  }
コード例 #2
0
  private void paintSliderBackground(Graphics g, Bitmap left, Bitmap middle, Bitmap right) {
    int sliderHeight = _imageSlider.getHeight();
    int sliderBackYOffset = (_totalHeight - sliderHeight) >> 1;

    // Left
    g.drawBitmap(0, sliderBackYOffset, _xLeftBackMargin, sliderHeight, left, 0, 0); // lefttop
    // Middle
    g.tileRop(
        _rop,
        _xRightBackMargin,
        sliderBackYOffset,
        _totalWidth - _xLeftBackMargin - _xRightBackMargin,
        sliderHeight,
        middle,
        0,
        0); // top
    // Right
    g.drawBitmap(
        _totalWidth - _xRightBackMargin,
        sliderBackYOffset,
        _xRightBackMargin,
        sliderHeight,
        right,
        0,
        0); // lefttop
  }