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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:22:14+00:00 2026-05-24T23:22:14+00:00

I have one image view (assigned one bitmap to it) and another bitmap (Transparent)

  • 0

I have one image view (assigned one bitmap to it) and another bitmap (Transparent) for painting. How it is possible to scroll this bitmap and background bitmap at the same time to be painted at different places.

  • 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-24T23:22:15+00:00Added an answer on May 24, 2026 at 11:22 pm

    From what I understood you are trying to draw on top of a image. If thats the case, create a custom view and get the image using BitmapFactory. After you get a bitmap object, use its copy method and use that copy for the canvas of the view.
    Now you can override the onDraw method of a custom view and draw anything on top of it.

    This view can be added to the layout, and scrolling will happen to the view.

    Edit: Sample Code

    Ok this is some code that might help you. I dont have the time to go through all your code.
    But I tried to understand your requirement.

    I am showing the code for an activity, its xml and custom view

    Activity.java

    public class DrawDemo extends Activity {
        private FrameLayout container;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.draw_demo_layout);
    
            container = (FrameLayout)findViewById(R.id.sc);        
            container.addView(new DrawView(this));
        }
    
        public void drawHandler(View target){
            container.addView(new DrawView(this));
        }
    
        public void clearHandler(View target){
            if(container.getChildCount() != 1){
                container.removeViewAt(container.getChildCount()-1);
            }
        }
    }
    

    draw_demo_layout.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="fill_parent" android:layout_height="fill_parent" 
        android:orientation="vertical">
        <FrameLayout android:orientation="vertical"
            android:layout_width="fill_parent" android:layout_height="0dip" 
            android:id="@+id/sc" android:scrollbars="horizontal"  
            android:layout_weight="1.0">
            <ImageView android:layout_width="fill_parent" 
                android:layout_height="fill_parent"
                android:src="@drawable/chips"/>
        </FrameLayout>
        <Button android:layout_width="fill_parent" 
            android:layout_height="wrap_content" android:text="Draw"
            android:onClick="drawHandler"/>
        <Button android:layout_width="fill_parent" 
            android:layout_height="wrap_content" android:text="Clear"
            android:onClick="clearHandler"/>     
    </LinearLayout>
    

    DrawView.java

    public class DrawView extends View {
    
        public DrawView(Context context) {
            super(context);
            setLayoutParams(new LayoutParams(LinearLayout.LayoutParams.FILL_PARENT
                ,LinearLayout.LayoutParams.FILL_PARENT)); 
        }
    
        public DrawView(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
    
        @Override 
        protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            Paint p = new Paint();
            p.setColor(Color.RED);
            p.setStrokeWidth(5);
            canvas.drawLine(50, 50, 100, 150, p);
            canvas.drawLine(100, 150, 20, 50, p);
        }
    }
    

    This activity has a framelayout which has a imageview as the base which holds the bitmap.
    We add a custom draw view on top of it and do our drawings on it.When we want to clear the drawing we remove the drawview and add another one if we need to draw again.
    This might not be the most efficient way. But should get you started.

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

Sidebar

Related Questions

I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
My scenario: I have one color background image JPG. I have one black text
I have one app, a UIImage* . I'm painting the image twice: Once in
If I have a button like the one in this image : http://www.freeimagehosting.net/image.php?4cd775814c.png how
BACKGROUND I have a script to upload an image. One to keep the original
i have a grid view which contain images when click on one image it
I have finger painting stuff on one view of my app. When the user
In my app i have an image view in one view controller and a
I have a linearlayout in which i have one image view, one textview ,
I have a simple function that do this: 1) User view some image and

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.