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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:25:30+00:00 2026-05-23T20:25:30+00:00

I have a back.png file which I need to assign to a variable and

  • 0

I have a back.png file which I need to

  1. assign to a variable and convert to bitmap
  2. apply a hue function to it
  3. and put it back
a = BitmapFactory.decodeResource(this.getResources(),R.drawable.back);

b = Hue(a);

View c = (View)findViewById(R.drawable.back);

///need to make View C = Bitmap B ... but how?

Here’s my code so far, everything works, only I don’t know how to assign my bitmap “b” back to view “c” … any ideas?

Thanks!

backrepeat.xml

<?xml version="1.0" encoding="utf-8"?>

    <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/back" 
    android:tileMode="repeat" />

AbsoluteLayout al = (AbsoluteLayout)findViewById(R.id.setLay);
Drawable dback = al.getBackground();
a = ((BitmapDrawable)dback).getBitmap();
//b = Hue(a);
d =new BitmapDrawable(a);
al.setBackgroundDrawable(d);

Edit, tired that one, but converting from a drawable to a bitmap and then back again makes it loos is tileing. I just get one bitmap stretched all over the screen…

  • 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-23T20:25:31+00:00Added an answer on May 23, 2026 at 8:25 pm

    wat r u doing…R.drawable.back must be a png file it cannot be a view….

    i mean view u must be using would be the main view like relative,absoulte,frame etc. or an imageview….u had to have one of such views

    edited–>>

    d=new BitmapDrawable(bm);
    rl.setBackgroundDrawable(d);

    where rl is my relative layout

    rl=(RelativeLayout)findViewById(R.id.brl);

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

Sidebar

Related Questions

The Back Story I have some decimal values which I am displaying as strings
I have a datetime coming back from an XML file in the format: 20080916
So I basically have this: $img = imagecreatefrompng('assets/other/redcircle.png'); imagepng($img); imagedestroy($img); So the redcircle.png file
I have written a program in Javascript which reads numbers from a file ,sorts
I have a piece of code like this IDB_PNG1 PNG images\\list-back.png HRSRC hrsrc =
I am making a game where I have a back ground image of a
I have a java back-end that needs to expose services to clients running in
I have been going back and forth between C# and Java for the last
I have to pass back information from a different source and can have a
I have a call back url, that i'm am pulling out the Lat and

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.