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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:36:08+00:00 2026-05-30T19:36:08+00:00

Here when i problem convert view to image in android then i am facing

  • 0

Here when i problem convert view to image in android then i am facing an error and close the application but when i write hardcoded fields for createbitmap function then it save black image in sd card …

  public static Bitmap loadBitmapFromView (View v) {
        Bitmap b,bitmap;
    int iwidth = 1435;
    int iheight=435;
        try
        {b = Bitmap.createBitmap(iwidth,  iheight, Bitmap.Config.ARGB_8888);
         //error  in next line 
        b = Bitmap.createBitmap( v.getWidth(), v.getHeight(),Bitmap.Config.ARGB_8888);                
         return b;
        }
        catch (Exception e) {
        Log.v("error", e.getMessage());
            return bitmap=null;
        }
  • 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-30T19:36:10+00:00Added an answer on May 30, 2026 at 7:36 pm

    Um, some shots in the dark:

    -Are you sure the view is not null and has a width and height that you can retrieve at the time of the call? I would have a check for that at the beginning- throw an error or return a null if the View v is null.

    -The method getWidth() returns a final int. I’m not a java expert but maybe that is messing something up, so try setting iwidth and iheight to getWidth() and getHeight() and then see if it works.

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

Sidebar

Related Questions

fairly new Android developer here. I've come across a strange problem that I'm not
I'm having a problem displaying an image in an image view, which is generated
I need to display in image on the view this way <img src =
I am trying to convert my iPhone only application to a Universal application. I
With the Razor view engine, I just want to convert a path like this:
In My Application i have Implement the Simple Gallery Demo. Here i am going
I am facing a strange problem when using the gridview control in ASP.NET. I
I have a database which contains list of image and video path. My problem
I'm trying to convert a small mvc2 application to the mvc3 razor syntax. In
I have a problem with my jqGrid. I have seen other posts here with

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.