I am trying to write a real time pitch visualization using TextureView. The
flow of the code I have implemented seems to be okay but I am unable to see
the pitch contour I am trying to plot.
So, I have created a custom view as ...
public class PitchSurfaceView extends TextureView implements
Hi All:
I have tried this sample, it works great. But when I change
lockCanvas(null) into lockCanvas(new Rect(x, y, x+20, y+20)), the example
starts to flicker.
It seems 'lockCanvas(Rect)' can not work well for TextureView or any other
reasons?
I am using Motorola XOOM with android 4.0.3.
I looked at this more and Romain Guy unsurprisingly got it 100% right.
My code pasted here is wrong.
DO NOT add
setWillNotDraw(true); in the TextureView and
mSurface.updateTexImage(); in the drawing thread.
They will mess it up!
On Thursday, 4 October 2012 17:17:33 UTC+2, Conrad Chapman wrote:
awesome. Thanks Conrad Romain.
@Romain : I fixed a rather expensive draw operation on the canvas in one of
my views (a custom listview actually - was performing a few primitive draws
in the onDraw method). I managed to define a Rect area to limit the bounds.
It opens up another question -
Thank you so much Romain for your reply and example. I might be the only
real canvas textureview example on the net. It worked but not quite as you
said. It might be something to do with my class structure as this part of
the program does not have internal classes..
I will explain and show a
As it happens our friend Romain Guy did have some ideas
https://groups.google.com/forum/?fromgroups=#!topic/android-developers/_Ogjc8sozpA
thank you
On Wednesday, 3 October 2012 11:34:58 UTC+2, Conrad Chapman wrote:
I have a similar problem but I was using SurfaceView properly as you
mention
Also asked in StackOverflow here
http://stackoverflow.com/questions/12688409/android-textureview-canvas-drawing-problems
I have an app that used SurfaceView to draw dynamic 2D graphs. It worked ok
but transormations etc as we know are not supported. So I went to
TextureView. My old code used
I have a similar problem but I was using SurfaceView properly as you
mention Romain Guy but changing my code over does not work. The problem and
code was posted here
http://stackoverflow.com/questions/12688409/android-textureview-canvas-drawing-problems
The unlockandpostcanvas method does
The problem is that you are calling updateTexImage() yourself. Do
*not* do this. You are interfering with TextureView, preventing it
from receiving the events that it uses to refresh the screen.
On Tue, Oct 2, 2012 at 7:40 AM, Conrad Chapman chapman.con...@gmail.com wrote:
Also asked in
Here is a fully working example of Canvas TextureView:
http://pastebin.com/J4uDgrZ8
On Wed, Oct 3, 2012 at 3:01 PM, Romain Guy romain...@android.com wrote:
The problem is that you are calling updateTexImage() yourself. Do
*not* do this. You are interfering with TextureView, preventing it
Hi Romain,
Thanks for your response.
I was experiencing a very interesting behavior. I started using a custom
view inside a framelayout, and performed all the primitive operations and
called invalidate() to let the system call onDraw. It was choking. I even
tried to invalidate a rect, but it
There is an overhead associated to invalidate() but unless your
hierarchy is extremely complicated it shouldn't be such an issue. But
you're right: SurfaceView can be used to avoid calling invalidate()
but don't override it's onDraw() method. You usually create a new
thread that renders onto the
Hello,
I am currently working on an app that requires computations/rendering based
on a variety of user inputs. I have implemented the SurfaceView and things
work as expected.
But I started facing performance issues when I tried to put this inside a
horizontal scroll view. Obviously it is not
Hi,
If you were using SurfaceView's onDraw() method then you were not
getting any benefit. You have to use
lockCanvas()/unlockCanvasAndPost() and post on the underlying Surface.
TextureView works in a similar way: you can call
lockCanvas()/unlockCanvasAndPost().
However, it seems all you need is
14 matches
Mail list logo