How to add text to image and save as new image

from stackoverflow

1. I’m trying to create an Android app that adds a random quote to images.

The general process is this:

  1. Start from a custom given image that shows when starting the app.
  2. From this image all the user can do is tap on it and generate a new random “quote” that get overlaid on the image.
  3. The user can save the newly created image with the quote he chose and set it as wallpaper.

I have got to the point where I can display the image in an ImageView. My list of quotes is stored in my strings.xml file.

Does anyone know how to put text underneath each image in a gridview?

You could use a TextView with a CompoundDrawable on top.

3. I’m trying to make an app for create custom cards. I’d like to add some text over a custom background (a jpg image). What is the best way of doing it? I’d need to show the user a preview of the card before send it to the server.

Editing here will involve many options like painting eye brows, changing face color, applying lipstick of different colors in lips, applying eye liner, changing hair style etc.

4. Android开发经验之在图片上随意点击移动文字

5. 得到EditText里面的内容,然后绘制在一张图片上,图片的布局控件是ImageView,但是ImageView我不知道怎么往它绘制文字,然后图片和文字合成一张图片

Bitmap b = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
c.drawBitmap(bitmap, 0, 0, null);
c.drawText(“hello,text”, 0, 0, new Paint());.

方法就是drawImage(),具体的做法就是: 需要写的字转换成Image,使用drawImage()函数,把生成的Image画到指定的位置就可以了


MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
contentLayout.layout(0, 0, contentLayout.getMeasuredWidth(),
Bitmap bitmap= contentLayout.getDrawingCache();


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Just another site

Jing's Blog

Just another site

Start from here......







Just another site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision


Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness



Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: