title: how to merge Android canvas?
body: <p>I was wondering, how do I merge/join Android canvases. In the code below I have <strong>cnv_left</strong> which contains a left part of a button. <strong>cnv_center</strong> contains the center part. And <strong>cnv_text</strong> contains text.</p>
  
  <p>What I need is to merge them all in <strong>cnv_joined</strong> , so that</p>
  
  <ul>
  <li><strong>cnv_left</strong> would go first.</li>
  <li>then <strong>cnv_center</strong>.</li>
  <li><strong>cnv_text</strong> would be in center of cnv_center.</li>
  <li>and a flipped <strong>cnv_left</strong> would be the last.</li>
  </ul>
  
  <p>Here's my code so far:</p>
  
  <pre><code> public void drawButt()
   {
  
        float buttonScale = 1.0f;     /// general button scale ratio
        float buttonScaleCnt = 6.0f;  /// button's center part stretch ratio
  
        LinearLayout LinLay = (LinearLayout)findViewById(R.id.linearLayout1);
        ImageView iv1 = new ImageView(this);
  
        Bitmap bit_left = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
        Canvas cnv_left = new Canvas(bit_left);
        cnv_left.scale(buttonScale,buttonScale);
        SVG svg_left = SVGParser.getSVGFromResource(getResources(), R.raw.btleft);
    Picture picture_left = svg_left.getPicture();
    picture_left.draw(cnv_left);
  
    Bitmap bit_center = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
        Canvas cnv_center = new Canvas(bit_center);
        cnv_center.scale(buttonScaleCnt, buttonScale);
        SVG svg_center = SVGParser.getSVGFromResource(getResources(), R.raw.btcnt);
    Picture picture_cnt = svg_center.getPicture();
    picture_cnt.draw(cnv_center);
  
    Bitmap bit_text = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
        Canvas cnv_text = new Canvas(bit_text);
    cnv_text.scale(buttonScale, buttonScale);
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setColor(Color.WHITE); paint.setTextSize(20);
    cnv_text.drawText("R", 2, 30, paint);
  
  
    Bitmap bit_joined = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888);
    Canvas cnv_joined = new Canvas(bit_joined);  
    /// somehow need to somehow join the above canvases into this cnv_joined...
  
  
        iv1.setImageBitmap(bit_joined);
        iv1.setPadding(5, 5, 5, 5);
  
        LinLay.addView(iv1); 
  
   }
  </code></pre>
  
  <p>Any ideas? Oh, and one more thing, when I create empty bitmaps for my canvas ( Bitmap.createBitmap(100, 100... ), does it matter what size I give them? If yes, where should I get the correct sizes for them?</p>
  
  <p>Thanks!</p>