It would appear to fail because scale is 1.00 or the matrix is the
identity matrix
testing for scale == 1.000 and setting it to 0.999998 makes the code work
and produces the
false false
true false
Why ?
On 02/07/2012 07:50 AM, New Developer wrote:
Thanks I got that to work however now reloading the image is causing
a problem
here is the code
Bitmap img = BitmapFactory.decodeFile(fName);
Log.i("display"," mute: " + img.isMutable() + " recycle:
" + img.isRecycled() );
Matrix matrix = new Matrix();
float scale = Math.min( (800.0f / img.getHeight()) ,
(1170.0f / img.getWidth()));
matrix.postScale(scale, scale);
pictBMP = Bitmap.createBitmap(img, 0, 0,
img.getWidth(), img.getHeight(), matrix, true);
Log.i("display"," mute: " + pictBMP.isMutable() + "
recycle: " + pictBMP.isRecycled() + " " + scale + " " +
matrix.toString() );
image.setImageBitmap(pictBMP);
pictCanvas = new Canvas(pictBMP);
If I load the original I get
false false
true false 0.73452 [0.73452 0.0 0.0] [0.0
0.73452 0.0] [0.0 0.0 1.0]
When I load the saved Image I get
false false
false false 1.0 [1.0 0.0 0.0] [0.0 1.0 0.0]
[0.0 0.0 1.0]
which then cause the pictCanvas = new Canvas line to fail
Unable to start activity ComponentInfo{...Display}:
java.lang.IllegalStateException: Immutable bitmap passed to Canvas
constructor
Caused by: java.lang.IllegalStateException: Immutable bitmap passed to
Canvas constructor
Any Ideas why the one is mutable and the other not, they are simply
jpg files are they not ?
On 02/06/2012 09:10 AM, Daniel Drozdzewski wrote:
Ok,
Create a LayerDrawable object and keep adding to it Drawable objects
(LayerDrawable.setDrawableByLayerId (int id, Drawable drawable))
extracted from each of your stacked Views.
On 6 February 2012 13:47, New Developer<secur...@isscp.com> wrote:
Thanks
I don't have access to the bitmaps (I don't think)
I have access to the ImageView and the Canvas associated with the ImageView
Thanks again
On 02/06/2012 08:37 AM, Daniel Drozdzewski wrote:
Draw each of the bitmaps on one canvas in the ascending order from
deepest to topmost.
On 6 February 2012 13:18, New Developer<secur...@isscp.com> wrote:
I have 4 ImageViews one stacked on top of the other all the same size,
each ImageView has it's own associated canvas that I can access.
Thus allowing me to view "layers" of a single image on screen.
I now wish to save this screen image to a file.
How can I merge the canvases into one image?
Thanks in advance
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email toandroid-develop...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email toandroid-develop...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en