In my application I am creating Excel file and saving it to memory card so can I convert this excel sheet or csv file into bitmap If yes than how ? Please help me.
Asked
Active
Viewed 1,728 times
0
-
I don't understand. You want your excel document to show as a image ? What if your excel sheet is so big, contains main data and might have many sheets ? Why do you want to convert it into bitmap ? What is the use of it ? – Rahul Gupta Nov 30 '13 at 15:09
-
No my excel sheet will have one sheet only.I want to convert it into bitmap so that i can share it into picasa or google+. – Aadi Dec 02 '13 at 05:06
2 Answers
1
I Dont know there is any method to convert excel sheet into bitmap but You can create bitmap same as you creating Excel sheat. for that you can use Canvas and drawText().
Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
Canvas c = new Canvas(bmp);
Paint paint = new Paint();
paint.setColor(Color.BLACK);
c.drawText("Hello world!", xPos, yPos, paint);
bmp.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream(destFilePath);
You can also set the font and text-size via the Paint-object. See this link How to set font and
Paint.setTextSize().
0
Easiest way is to take a screenshot while the excel file is displayed. The usual Android way- hold down power button and home button simultaneously. The pic will get stored in a gallery.

Rajib
- 453
- 7
- 10
-
ya now I am creating bit map of view displayed on screen(excel file details is displayed). But it will be better if I can convert .xls or .csv file to bitmap. – Aadi Dec 02 '13 at 05:04
-
@user3052198 Libreoffice and Openoffice can export to pdf- if that helps. – Rajib Dec 02 '13 at 05:06