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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:00:27+00:00 2026-06-13T07:00:27+00:00

My problem is that, i can’t view all the image or some pixels. I

  • 0

My problem is that, i can’t view all the image or some pixels.

I have a imageview and bitmap on it. And with canvas library, I drawing the imageview limits. But the result is wrong. Why not sample the left and lower boundaries of the image? If I increase the brush size if it is.

Image : https://i.stack.imgur.com/R3Byw.jpg

I will show only the code of this part of my app

//Init imagebitmap
largeBitmap = Bitmap.createBitmap(200,200, Bitmap.Config.ARGB_8888);

//Init canvas
canvas = new Canvas(largeBitmap);
canvas.drawColor(0xffffffff);

//Set largeBitmap on Image
as.setImageBitmap(largeBitmap);

//Init Pincel
pincel1 = new Paint();
pincel1.setARGB(255, 0, 0, 0);

//Draw Limits
int ancho = canvas.getWidth();
int alto = canvas.getHeight();

canvas.drawLine(0, 0, ancho, 0, pincel1); // Superior
canvas.drawLine(0, alto, ancho, alto, pincel1); // Inferior
canvas.drawLine(0, 0, 0, alto, pincel1); // Izq
canvas.drawLine(ancho, 0, ancho, alto, pincel1); // Drch

xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/sv"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center_vertical|center_horizontal" >

    <HorizontalScrollView
        android:id="@+id/hsv"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center_vertical|center_horizontal" >

        <LinearLayout
            android:id="@+id/ll"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="center_vertical|center_horizontal"
            android:gravity="center_vertical|center_horizontal" >

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:contentDescription="@string/app_name"
                android:scaleType="center"
                tools:context=".SIDetailFragment" />
        </LinearLayout>
    </HorizontalScrollView>

</ScrollView>

I set scrollview only for test the bitmap image with scroll views on a easy form

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-13T07:00:29+00:00Added an answer on June 13, 2026 at 7:00 am

    It’s because you’re going “too far”. As with (almost) everything in programming, canvas indexes are 0 based. So you need to use ancho -1 and alto - 1.

     canvas.drawLine(0, 0, ancho - 1, 0, pincel1); // Superior
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem that I can ref a button for control it. I
i have a problem that i can't solve ! (sqlite3, but i think it
I have a problem that I can't resolve. Let's say I have this map
I'm facing a problem that I can summarize as it follows: I have a
I have a weird problem that i can't figure out a solution for: I've
I have a strange problem that I can't seem to solve. I've quite a
I have a bit of a problem that I can't seem to code my
I have a problem that can be simplified as follows: I have a particular
I have a problem that can essentially be viewed as a graph. I'm considering
I have one problem that I can't resolve. I have 2 tables. Table 1:

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.