What is wrong with saving image into sqlite database?
<p>I want to write an image into database as blob type. But when i load this image from database, it's different from source image. I write source image into database as follow:</p>

<pre><code>  ByteArrayOutputStream bs = new ByteArrayOutputStream();
Bitmap medBmp = BitmapFactory.decodeStream(this.getResources().openRawResource(R.drawable.source_image));
            medBmp.compress(Bitmap.CompressFormat.JPEG, 100, bs);
            initialValues.put(IMAGE_COL,bs.toByteArray());  
</code></pre>

<p>And here are images</p>

<p>source image:
<img src="http://i.stack.imgur.com/5CiyV.png" alt="enter image description here"></p>

<p>Image is loaded from database
<img src="http://i.stack.imgur.com/tLtRZ.jpg" alt="enter image description here"></p>

<p>The background of source image is transparent, but the image is loaded from db has background in black.why are they different?What is wrong with my code?</p>

<p>Please help me out, thanks you so much.</p>
