I have a cropped bitmap image and I need to save it into a jpeg file.
Thanks in advance
Converting a vector graphic or object to a bitmap lets you apply special effects to the object with CorelDRAW. The process of converting a vector graphic to a bitmap is also known as “rasterizing.” When you convert the vector graphic, you can select the color mode of the bitmap.
Use this:
Bitmap bmp = null; ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.JPEG, 100, stream); byte[] byteArray = stream.toByteArray();
for that you can use this:
FileInputStream fileInputStream = null; File file = new File("yourfile"); byteArray = new byte[(int) file.length()]; try { //convert file into array of bytes fileInputStream = new FileInputStream(file); fileInputStream.read(bFile); fileInputStream.close(); //convert array of bytes into file FileOutputStream fileOuputStream = new FileOutputStream("C:\\testing2.txt"); fileOuputStream.write(bFile); fileOuputStream.close(); System.out.println("Done"); } catch (Exception e) { e.printStackTrace(); }
and also for more info go with here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With