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

  • SEARCH
  • Home
  • 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 7172873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:42:22+00:00 2026-05-28T15:42:22+00:00

Possible Duplicate: Can i save lots of bitmaps to one bitmap? (2d) I wonder

  • 0

Possible Duplicate:
Can i save lots of bitmaps to one bitmap? (2d)

I wonder how canvas.save and canvas.restore really works.

how i want it to work, and how i use it (but doesnt work).

  1. lock the canvas
  2. do some drawing with out unlockandpost
  3. canvas.save() (store the int)
  4. Do some more drawings
  5. Post the canvas
  6. Restore the canvas from step 3
  7. Do some more drawings, repeat from 6 (loop)

What i really need is to save my canvas at a certain stage ( the background), and then draw objects above it, without having to draw the background everytime i want to update my canvas.

  • 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-28T15:42:23+00:00Added an answer on May 28, 2026 at 3:42 pm

    Canvas.save() & restore() don’t act on the bitmap attached to the canvas… they exist to control aspects of the canvas drawing environment, specifically the current clipping area and the matrix.

    You’d use save() and restore if you wanted to, say, draw a rotated sprite. To do that, you’d first save() the current canvas state, then you’d translate() so that the origin – pixel address (0,0) – is where you want the sprite to go, then you’d rotate(), and then you can drawBitmap(). Finally you can restore() the drawing environment back to normal.

    So you’re basically doomed to draw the background every time. If this is a complex operation, store it in an offscreen bitmap. So long as the background can be drawn in a single operation (drawBitmap, say) performance shouldn’t suffer too much.

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

Sidebar

Related Questions

Possible Duplicate: Returning a reference can work? Why this code works ( matrix is
Possible Duplicate: Save Youtube video to iPhone in the app I want to download
Possible Duplicate: How to save picture to iPhone photo library? I want to know
Possible Duplicate: save image from php url using php How can i use php
Possible Duplicate: How can I save and load the alpha values of a UIButton
Possible Duplicate: Can't get Twitter OAuth callback authentication to work in Cocoa application I
Possible Duplicate: How can I detect the browser with PHP or JavaScript? I want
Possible Duplicate: Can’t operator == be applied to generic types in C#? I've got
Possible Duplicate: Can’t operator == be applied to generic types in C#? I've coded
Possible Duplicate: Can you animate a height change on a UITableViewCell when selected? This

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.