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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:15:54+00:00 2026-05-22T14:15:54+00:00

I am creating my own view and drawing a bitmap in the canvas.If I

  • 0

I am creating my own view and drawing a bitmap in the canvas.If I set it at say (100,100) it is fine on a 320*480 screen but on bigger 480*800 it does not show up in the same place.

How can I get it to be at the same place.I have searched Google much but can’t find a solution.

Any tips? Tutorials?

Thanks

  • 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-22T14:15:55+00:00Added an answer on May 22, 2026 at 2:15 pm

    You can use this method in your custom view to get the exact size of the canvas. Then you can calculate the position and the size of the rectangle where you will draw you bitmap.

    @Override public void onSizeChanged (int w, int h, int oldw, int oldh){      
      super.onSizeChanged(w, h, oldw, oldh); 
    
      canvasW = w;   
      canvasH = h; 
    
    } 
    

    You can also resize your bitmaps within this method to accomodate the size of the canvas.

    Even though your canvas may take the full screen, in Android 3.0 there is a bar on the bottom which will take some space, hence onSizeChanged gives a real size of the canvas.

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

Sidebar

Related Questions

I've created my own view by creating a subclass of the SurfaceView class. However
I am attempting to experiment in creating my own Views by subclassing View. I
I'm working with creating my own custom view templates programmatically for the app I'm
Is there any resource or book for creating own linux distro.Only good resource i
I am using media player to play audio and video. I am creating own
Im creating my own blog managing app in rails (for experimental purposes).... What would
When creating my own class in Qt I would like my variables in the
I am creating my own carousel slideshow for images, using Jquery. Currently i have
So I am creating my own website for the first time and after a
I am creating my own custom T4 Template that integrates with an ADO.NET Entity

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.