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 3230572
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:56:34+00:00 2026-05-17T16:56:34+00:00

I’ve been wondering if canvas has a limit boundary. I mean if I use

  • 0

I’ve been wondering if canvas has a limit boundary.

I mean if I use functions such asdrawline(), drawbitmap(), drawcircle(),
does android really draw something on the canvas and waste some CPU cycles??

because after all the drawing functions, the actual picture print on the screen is decided
by the screen size. And if I draw on something that is out of screen size, it doesn’t show up.

I want to do some small detail on my canvas by calling lots of drawing functions and make my surface “bling bling”. If it is out of bound I don’t want to use them, if they make my drawing slow down.

I am working on a little game by the structure of surfaceview, Thanks for any advice.

for Example:

I have a robot walking from a <-> b OUTSIDE the screen.

it takes 20 drawing functions to draw a robot walking picture on the canvas.
If I scroll the screen, then I can see the robot.

So if the drawing function outside the screen really takes as much time as draw on screen.
I have to detect that only if the robot’s position can be seen by the user, then I draw.
otherwise, i don’t.

if the drawing function doesn’t waste much CPU cycles, then I can just draw everytime even if the current screen cannot see the robot.

  • 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-17T16:56:34+00:00Added an answer on May 17, 2026 at 4:56 pm

    Your canvas is backed by your bitmap (2D), or openGL (3D,which I have no experience with). All drawing on your canvas is clipped to the clipping rectangle, which you can grow, shrink, intersect with new rectangles or paths, etc. So, you really want to manage your clipping rectangles before you draw into your canvas, especially if it’s backed by a large bitmap. If you clip to a region that’s equal to the screen size you will save CPU cycles. If your game is a scroller type game, you can clip to a region larger than the screen size and pan around, drawing offscreen occasionally to update the area that’s coming onto the screen. if your game has infinite scrolling in all directions then you’ll want to have multiple smaller canvases that you can draw into all around your main central canvas, and flip them around left to right, top to bottom depending on the directions of your scrolling game. One large bitmap with one canvas might have too big of a memory footprint for a small device.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters

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.