title: Scale Image Size in Kotlin Android Studio
body: <p>I am receiving a base64 image from an api that is 192x192 in size. I am using the following code to change the base64 data into a Bitmap. </p>
  
  <pre><code>    fun Base64ToBitmap(myImageData: String): Bitmap {
      val imageAsBytes = Base64.decode(myImageData.toByteArray(), Base64.DEFAULT)
      return BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.size)
  }
  </code></pre>
  
  <p>Then I am using the following code to replace the previous contents of my ImageView.</p>
  
  <pre><code>ImageHeader.setImageBitmap(img)
  </code></pre>
  
  <p>The xml for that ImageHeader are as follows.</p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/ImageHeader"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="100dp"
      android:contentDescription="@string/ImageHeader1"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintHorizontal_bias="0.497"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="@+id/text_home"
      app:srcCompat="@drawable/defaultpng" /&gt;
  </code></pre>
  
  <p>As expected this makes a very small image on the app. Is there anyway I can scale it's size x2 or x4 without having to create a larger image from my base php api? Sending extra data over the API seems like a waste.</p>