Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Android系统色彩模式RGB_565的问题

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, java

Research direction

Start by reviewing the chapter that states Android’s default color mode is RGB_565, then inspect the shown onDraw example using BitmapFactory.decodeResource, Bitmap, Canvas, and R.mipmap.maps. Compare the documented claim with the reported bitmap dimensions and byte count, and update the relevant explanation so it clearly distinguishes image configuration from device behavior.

Written by the indexing model from the issue text.

Description

记得作者之前章节写过,Android的默认色彩模式是RGB_565.

我在后面章节在做测试时发现一个问题:

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.maps);
        canvas.drawBitmap(bitmap, new Matrix(), null);
    }

我的bitmap的大小是byte[394383], 图片分辨率是314 * 314。计算一下,394383 / (314 * 314) = 4。也就是说一个像素点占位4个字节。(RGB_565我记得是1个像素占位2个字节,而ARGB_8888是1个像素4个字节)

问下,是不是Android的默认色彩模式不同的手机系统不一样?还是只是图片色彩模式不一样?

Dominant language
Java
Stars
9.3k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GcsSloop/AndroidNote

All issues in GcsSloop/AndroidNote

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.