the following sequence allows textview.draw to work (and i assume for
other views this will work too):
tx.setLayoutParams(new ViewGroup.LayoutParams(width, height));
int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(width,
View.MeasureSpec.EXACTLY);
int heightMeasureSpec =
View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY);
tx.measure(widthMeasureSpec, heightMeasureSpec);
tx.layout(bounds.left, bounds.top, bounds.right,
bounds.bottom);
On Oct 6, 10:34 am, alan <[EMAIL PROTECTED]> wrote:
> calling measure and layout applies the size changes and debugging
> through ondraw more now seems to be done but still nothing is painted
> to the canvas
>
> On Oct 6, 10:10 am, alan <[EMAIL PROTECTED]> wrote:
>
> > I am encountering similar problems myself. I am also trying to draw a
> > textview onto a canvas. setWidth and setHeight dont seem to do
> > anything and getWidth and getHeight always return 0 which is i think
> > the reason nothing is drawn to the canvas
>
> > On Sep 26, 9:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > So this shows us how to do 2D on top of 3D. What is the qualitative
> > > performance hit of this approach on a device with a GPU? How can 3D
> > > on top of 2D be done? What of its performance? :-)
>
> > > For a limited application, I am trying out the approach of having View
> > > objects render into an OpenGL texture and just having a single OpenGL
> > > renderer that blasts all those textured quads to the screen when
> > > something needs updating. Has anyone experimented with this? I'm
> > > currently having problems even creating a TextView in code and having
> > > it render to a canvas:
>
> > > TextView tx = new TextView(mView.getContext());
> > > tx.setText("Nathan");
> > > tx.setWidth(256);
> > > tx.setHeight(256);
> > > tx.draw(canvas);
>
> > > The call to "tx.draw(canvas);" has no effect on the canvas image.
>
> > > Any shared wisdom on these topics is appreciated!
>
> > > -Nathan
>
> > > On Sep 19, 6:57 am, "Mike Reed" <[EMAIL PROTECTED]> wrote:
>
> > > > SeeSurfaceViewOverlay.java sample code.
>
> > > > On Fri, Sep 19, 2008 at 5:00 AM, Shraddha Bhaskare
>
> > > > <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi,
>
> > > > > I need to know if 2D and 3D can co-exist on the same view.
> > > > > Can we have 2D and 3D views on the same screen?
>
> > > > > Thanks in advance
> > > > > Shraddha
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---