Monday, April 9, 2012

[android-developers] Getting a complete bitmap.

I have a bitmap, a canvas, and an imageview. They are set up something
like this:

mBitmap = Bitmap.createBitmap((int) mWidth, (int) mHeight,
Bitmap.Config.ARGB_8888);
mCanvas = new Canvas(mBitmap);
mImageView.setImageBitmap(mBitmap);


I flood the mCanvas with a color like this:

mCanvas.drawColor(color);

I then draw on the canvas at various points like this:

mCanvas.drawLine(inputDownX, inputDownY, inputUpX, inputUpY,
thisPaint);

I would like to get the image drawn on the screen and use this to do
that:

BitmapDrawable drawable = (BitmapDrawable) mImageView.getDrawable();
Bitmap bitmap = drawable.getBitmap();

When I do that though, even though there is a drawing on the screen,
all I see in the created bitmap is the flood color...none of the
lines.

Any idea what is going on? I thought the getDrawable().getBitmap()
should get everything but it's almost like the mCanvas.drawLine is
going to something other than where the drawColor is, but it isn't
coded that way.

Thanks!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate