title: Android: is there way to limit the barcode height and width
body: <p>I am referencing this to generate code39 format 1D barcode using Zxing library.</p>
  
  <p><a href="https://stackoverflow.com/questions/10353392/generate-barcode-image-in-android-application">Generate barcode image in Android application</a></p>
  
  <p>I can generate the barcode. Because i will have three different codes to show in the UI. 
  Three different codes can have different length like below:</p>
  
  <pre><code>String barcode1_data = "1234567EA";
  String barcode2_data = "1234567891012388";
  String barcode3_data = "123456789000100";
  
  bitmap1 = encodeAsBitmap2(barcode1_data, BarcodeFormat.CODE_39, 800, 120);
  bitmap2 = encodeAsBitmap2(barcode2_data, BarcodeFormat.CODE_39, 1200, 150);
  bitmap3 = encodeAsBitmap2(barcode3_data, BarcodeFormat.CODE_39, 1200, 150);
  </code></pre>
  
  <p>The result UI like this:
  <a href="https://i.stack.imgur.com/p4Uqk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p4Uqk.png" alt="enter image description here"></a></p>
  
  <p>I would like to have the three different barcodes to have the same height, and also the width depends on the characters. In my sample code, i hard coded, but i want it to be dynamic. Is there any rule to calculate the height and width?</p>