Monday, January 7, 2013

Re: [android-developers] Convert a view (layout) to a Bitmap

Maybe you could explicitly call the drawing method of the View passing in your own Canvas?



On Sunday, January 6, 2013 6:21:11 AM UTC-6, Justin Buser wrote:

I agree that people deserve respect, however I don't feel that my response was disrespectful. If I was curt it was only because I felt that the situation warranted it. Furthermore, I clearly and succinctly explained exactly why his response was incorrect and misleading as well as why I found his answer so frustrating so I'm not really sure how to respond to this. Scolding me for scolding someone seems kind of hypocritical, especially when you have no point.

 

From: android-d...@googlegroups.com [mailto:android-d...@googlegroups.com] On Behalf Of James Black
Sent: Sunday, November 18, 2012 7:20 AM
To: android-d...@googlegroups.com
Subject: Re: [android-developers] Convert a view (layout) to a Bitmap

 

People deserve respect when not being nice, but if you want to attack Guy I would suggest you watch him on YouTube and as mentioned, Google him.

He helps answer questions to share from his depth of knowledge, so if you factually disagree be to the point and show where he erred, without the attacks.

On Nov 17, 2012 3:19 PM, "Justin Buser" <justin...@gmail.com> wrote:

I don't understand why I keep finding different posts by you about forcing  layout passes.  The View instance this person is referring would never go through a layout pass, regardless of the point at which his code was executed for several reasons, most notably because it's never even added to the display list. Additionally, even if it was added to the Window correctly, calling layout() would not "force the layout", you would call forceLayout() for that but even that would be pointless because the View doesn't have a layout assigned to it or even have anything to layout in the first place.

 

The truly aggravating thing however is the fact that neither the question itself, nor the actual answer ever have anything to do with "forcing layouts". Do you understand that when other people come across invalid/irrelevant information like this and believe it (if not because you claim to be a developer then simply because they don't know any better) then it's no longer a forgivable case of simply being wrong about something. At that point you are responsible for every adverse reaction your bad information results in. Every application crash/exception thrown/hour lost/dead kitten/etc... that occurs when someone tries your solution and it doesn't work is on your head.

 

As a human being you should feel morally obligated to not present anything as fact unless you are 100% confident that it is indeed so. At the very least you should have first hand experience as it pertains to the information you are providing and if not then test / verify it before hand. Although each individual  failure in this may seem relatively insignificant, the aggregate result will ultimately have a negative impact on our evolutionary progress as a species. As far fetched as you may find this to be the vast multitude of problems that threaten our very existence are at some level caused by ignorance, as such it should not be taken lightly at any level.


On Monday, November 17, 2008 11:20:41 AM UTC-5, Romain Guy wrote:

Hi,

If you do this in onCreate(), then the View didn't go through a layout
pass yet, so its size is null (0 by 0 pixels.) You need to either wait
for the first layout, or force the layout by calling layout() on the
View.

On Mon, Nov 17, 2008 at 2:34 AM, Jose Cortes <jbee...@gmail.com> wrote:
>
> Hello everybody.
>
> I am working with OpenGL and Android, and I was wondering if there is
> any way to create a Bitmap or a Drawable using a view (layout). The
> purpose is to use this Bitmap as Texture for an OpenGL figure.
>
> All I have untill now is:
>
> ** I create a new view from the context and the Id.
>
> View l = new View(context);
>
> l.findViewById(R.layout.main);
>
> ** I used DrawingCache...but dont know if it is well used:
>
> l.setDrawingCacheEnabled(true);
>
> Bitmap bmp = l.getDrawingCache();
>
> this bmp is null...
>
>
> Any idea?
>
> Thanks
> >
>



--
Romain Guy
www.curious-creature.org

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@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

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@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

--
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

No comments:

Post a Comment