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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:50:49+00:00 2026-05-30T09:50:49+00:00

It is possible to render a view at a low resolution, and then scale

  • 0

It is possible to render a view at a low resolution, and then scale it up to fit the actual size of your view using the setFixedSize() method of a SurfaceHolder. However, the scaling is done with some kind of interpolation, causing everything to blur.
Is there any method for changing the method of interpolation to nearest neighbour or just turning it off?

Here is an example of what I mean, Made with a 4×4 surface in a fullscreen-view:
What I want What I get
Left image: This is how I want the result to look (here achieved by drawing a nonfiltered bitmap)
Right image: This is what happens when the 4×4 canvas is scaled to fullscreen.

Sample code for generating the right image if anyone’s interested:

public class ScaleView extends SurfaceView implements SurfaceHolder.Callback {
    private final static float[] points = {0,0, 2,0, 4,0, 1,1, 3,1, 0,2, 2,2, 4,2, 1,3, 3,3};
    private Paint white;
    public ScaleView(Context context) {
        super(context);
        white = new Paint();
        white.setColor(0xFFFFFFFF);
        getHolder().addCallback(this);
    }
    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height){
        Canvas c = holder.lockCanvas();
        try{
            c.drawPoints(points, white);
        }finally{
            holder.unlockCanvasAndPost(c);
        }
    }

    @Override
    public void surfaceCreated(SurfaceHolder holder){
        holder.setFixedSize(4, 4);
    }
    @Override
    public void surfaceDestroyed(SurfaceHolder holder){}
}

Note: The square pattern above is just an example of the effect I want to avoid. I am looking for a general solution that can be applied to any view (with a surfaceholder) with any content.

  • 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-30T09:50:50+00:00Added an answer on May 30, 2026 at 9:50 am

    Sorry, you can’t control this. It is not defined what kind of scaling will be done on these surfaces — it depends on the hardware and how it is configured. Also, this kind of extreme scaling really should be avoided, since in some cases hardware can’t do it so you will end up in slower paths. (For example if surfaces are being put into overlays, many hardware overlay engines can’t do that kind of extreme scaling.)

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

Sidebar

Related Questions

How do I render a view within another view... in rails... is it possible?
I'm using OpenGL to render a game view in my android application. The game
is it possible to use Spring 3.1 MVC without using a view resolver? The
Is is possible to re-render a view after JSON has loaded? The current template
Possible Duplicate: Render a view as a string Hi I am wondering is it
Possible Duplicate: render the values of controllers to view I am newbie to php
Is it possible to render a view from a class, which is not controller?
I was wondering if it's possible to render an Html Helper in a View
Is it possible to render view of another controller? Because when i'm trying to
Is it possible to render empty <div style=width:50%> </div> with CSS in xHTML strict

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.