Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Setting Background Image of View with onDraw Creates Finger Lag
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt M  
View profile  
 More options May 18 2011, 3:06 pm
From: Matt M <matthew.mag...@gmail.com>
Date: Wed, 18 May 2011 12:06:41 -0700 (PDT)
Local: Wed, May 18 2011 3:06 pm
Subject: Setting Background Image of View with onDraw Creates Finger Lag
Hello,

I have a finger painting portion in my app that I built off of
FingerPaint.java
http://developer.android.com/resources/samples/ApiDemos/src/com/examp...

I am trying to set a background image using setBackgroundDrawable()
but upon doing so there is a significant amount of lag created when
painting (the tip of the paint lags behind the user's finger). I'm
calling view.setBackgroundDrawable in onCreate(). Any ideas on a fix?

Any help greatly appreciated!

Matt.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dianne Hackborn  
View profile  
 More options May 18 2011, 3:56 pm
From: Dianne Hackborn <hack...@android.com>
Date: Wed, 18 May 2011 12:56:17 -0700
Local: Wed, May 18 2011 3:56 pm
Subject: Re: [android-developers] Setting Background Image of View with onDraw Creates Finger Lag

Um, run on a faster device.  Or don't do that.  It is a lot more work to
draw an image than fill a color...  and if your background image isn't the
exact size of the view, it also needs to be scaled which *significantly*
slows it down.

If you use the hardware accelerated drawing feature of HC then bitmaps are
basically not more expensive than drawing the screen, so now with HW acceler
turned on a standard part of the theme has a background bitmap.  However you
still really need to think about what you are doing -- Tegra 2 has enough
bandwidth I believe to paint the entire 1280x800 screen about 2.5 times, so
you really need to decide for each layer you add to your UI whether it is
actually worth it.

--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »