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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:11:28+00:00 2026-06-15T03:11:28+00:00

I want to draw a stack which should raise from the bottom. For example

  • 0

I want to draw a stack which should raise from the bottom. For example the stack height is 400, from the height 10 it should grow till it reaches 400.

I want to do this using paint and canvas.

I don’t want to do it with image view/bitmap and scale animation.

Is it possible to do this with canvas and paint? if so how to achieve it?

Thanks in advance.

  • 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-15T03:11:30+00:00Added an answer on June 15, 2026 at 3:11 am

    What ever you do with canvas, even if you try for loop or invalidate, sleep, after all its drawing the shape in single stretch. I found the result in following way. May be it would be helpful for someone else, so adding the code here.

    import android.os.Bundle;
    import android.os.CountDownTimer;
    import android.app.Activity;
    import android.graphics.Color;
    import android.util.Log;
    import android.view.Menu;
    
    public class AndroidDraw extends Activity {
    
    private DrawView drawView;
    private int height = 300;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_android_draw);
    
    
    
        CountDownTimer timer = new CountDownTimer(2000, 50) {
    
            @Override
            public void onTick(long millisUntilFinished) {
    
                height = height - 10;
                drawView = new DrawView(AndroidDraw.this, height);
                drawView.setBackgroundColor(Color.WHITE);
                setContentView(drawView);
            }
    
            @Override
            public void onFinish() {
    
            }
        };
        timer.start();
    }
    
    }
    
    
    
    
    import android.content.Context;
    import android.graphics.Canvas;
    import android.graphics.Color;
    import android.graphics.Paint;
    import android.view.View;
    
    public class DrawView extends View {
    Paint paint = new Paint();
    private int height;
    
    public DrawView(Context context, int height) {
        super(context); 
        this.height = height;
    }
    
    @Override
    public void onDraw(Canvas canvas) {
    paint.setColor(Color.RED);
        canvas.drawRect(30, height, 60, 300, paint );
    
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to draw a widget (in this example, a canvas) and then remove
I want to draw some Rectangle over a single Image . For example I
I want to draw an area from given points on a map using the
i want to draw line, i have two textfiled in which i enter some
Is my professor asking me to draw the stack? Does he want me to
I want to draw a line between two points: https://i.stack.imgur.com/Yuhsd.gif Lets say that I
So I'm using Processing to draw a map from a data file. I want
I want to draw an earth globe on android. At this point I need
I want to draw rectangle that is only specified percent high of panel im
I want to draw circle, and i want to re size it based on

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.