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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:01:07+00:00 2026-06-03T21:01:07+00:00

I am making an oscilloscope in android. So far I have made the base

  • 0

I am making an oscilloscope in android. So far I have made the base axis, this axis are drawn each time the program starts. Now I want to make the performance a bit better by saving the axis canvas after the first time that it is created. My idea is to save this canvas as a bitmap and recall it next times:

    public class ScopeCanvas : View
    {

        private Context _context;

        public double TimeBase { get; set; }
        public double VoltagePerDiv { get; set; }

        private Canvas _axisCanvas;
        private Bitmap _savedAxisCanvas;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="context">Context</param>
        public ScopeCanvas(Context context, double timeBase, double voltagePerDiv) : base(context)
        {
           _context = context;

            TimeBase = timeBase;
            VoltagePerDiv = voltagePerDiv;
        }

        protected override void OnDraw(Canvas canvas)
        {
            base.OnDraw(canvas);

            if(_axisCanvas == null)
            {
                _axisCanvas = CreateAxis(canvas);

#if DEBUG
                Console.WriteLine("Axis canvas newly created!");
#endif
            }
            else
            {
#if DEBUG
               Console.WriteLine("Using pre made axis canvas!");
#endif
            }
        }
}

Can somone pleae tell me how can I save this canvas and recall it later? I mean in the OnDraw event!

P.S: CreateAxis(canvas) is the method that I draw the axis on it. This is how it looks:
enter image description here

Since I dont want to hard code a fixed distance between voltage and time base division, this need to be drawn dynamicly atleast the first time it creates (resoloution independent) using things like ExactCenterY and etc…

  • 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-06-03T21:01:10+00:00Added an answer on June 3, 2026 at 9:01 pm

    you “could” reference it to a member-variable, but this won’t be a good idea.
    If you want to draw later on that canvas, try to invalidate your view (again) so that the onDraw() method is called again and you can use the given canvas.

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

Sidebar

Related Questions

Making a simple program which will generate a multiple choice form. I have an
I making web games in java and having troubles each time when getting to
I´m making an Android App with a Google Map. This app must alert you
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created
When making relations between tables (in mysql), I have encountered a naming dilemma. For
Making a mobile friendly site, I have a single field and a submit button.
Making a small WCF test program which is based on a Store that has
making a multi-language site with codeginiter. I have created two folders. One for french
Making good progress on rails now, but hit a snag on heroku deployment. After
Will making WPF forms in VS2010 be easier than it is now? I’m just

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.