Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4019328
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:05:28+00:00 2026-05-20T10:05:28+00:00

I just started writing a live wallpaper. What I would like to do is

  • 0

I just started writing a live wallpaper.

What I would like to do is to set the background to a bitmap from my resources. And I will draw my animations on top of this.

What is the most efficient way to do this? Is there a way to set the background to a bitmap in a live wallpaper? Do I just need to draw the bitmap into the canvas each time before I draw my animations (which seems like it might be hideously inefficient)?

thanks,

Jay

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:05:28+00:00Added an answer on May 20, 2026 at 10:05 am

    This is what I found.

    From the eclipse graphic documentation:

    Note: On each pass you retrieve the Canvas from the SurfaceHolder, the previous state of the Canvas will be retained. In order to properly animate your graphics, you must re-paint the entire surface. For example, you can clear the previous state of the Canvas by filling in a color with drawColor() or setting a background image with drawBitmap(). Otherwise, you will see traces of the drawings you previously performed

    So the code I used is as follows:

    in onCreate()
    mBitmapBase = BitmapFactory.decodeResource(getResources(), R.drawable.bidBackground);

    in onSurfaceChanged()
    // size the background bitmap so it draws efficiently
    mBitmapBackground = Bitmap.createScaledBitmap(mBitmapBackground, xMax, yMax, true);

    and in Run()
    try
    {
    canvas = sHolder.lockCanvas();
    if (canvas != null)
    canvas.drawBitmap(mBitmapBackground, 0, 0, null);

    As far as I can tell this is as efficient as it can get. Although if anybody can correct me on this I would love to hear it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started learning Python... I am writing a simple program that will take
gcc 4.4.2 cmake 2.6 I have just started using cmake. Coming from writing my
I just set foot on JSP. I started writing simple programs to display dates,
I just started writing powershell scripts for Citrix XenServer. However, I can only find
I've just started writing a reasonably straightforward site using sinatra. My problem is that
I've just started writing GAE web applications in Java so I'm kind of new
I'm just getting started on writing functions instead of writing everything inline. Is this
I have just started learning Jquery and am new to writing javascript (I am
I have just installed C# 2008 Express Edition 2008 and started writing code. My
I am just getting started couchdb and have been looking into writing couch apps.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.