image background - how to repeat an image rather than strech it

by liordav » Wed, 12 Jan 2011 16:57:49 GMT


Sponsored Links
 Hi,
I have an image I want to use as a background to some layout.
the problem is the image contains a texture of slant lines, so if i
use a 1 pixel width image or a 9 patch the image is stretched and the
texture is Twitching, so i can see the slant lines as latitude lines.
I saw that he android emulator uses a similar texture in the progress
bar indeterminate animation, is there a special/simple definition to
order the background image to repeat itself rather than stretch? is
there a way to do it with 9 patch, cause eventualy i also need the
corners to be round.
thanks for the help.

-- 



Re: image background - how to repeat an image rather than strech it

by Doug » Thu, 13 Jan 2011 07:26:17 GMT


 See BitmapDrawable and its related xml configuration documentation if
you want to tile an image for the background of a View.




-- 


Sponsored Links


Re: image background - how to repeat an image rather than strech it

by Muhammad Ali » Thu, 13 Jan 2011 16:07:05 GMT


 You can create a bitmap in memory, using your own file and draw it in
background. It will help you like the repeat image.






-- 



Re: Re: image background - how to repeat an image rather than strech it

by Richard Leggett » Sat, 15 Jan 2011 01:51:25 GMT


 An easy way of making a bitmap repeat is to create an XML file in the drawable 
folder which looks something like this:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android=" http://schemas.android.com/apk/res/android" ;
    android:src="@drawable/background" 
    android:tileMode="repeat" />

"background" is a PNG in the same folder, it doesn't sound like you need a 9 
patch in this case. Simply assign @drawable/repeatingbackground or whatever you 
called the file, in place of the original bitmap. 

As for rounding corners, you can subclass the view you are rendering (let's say 
an ImageView) and use clipping to mask the corners, there are a few examples 
here:

 http://stackoverflow.com/questions/2459916/how-to-make-an-imageview-to-have-rounded-corners 

I'm presenting techniques here that are more generalised and re-useable and not 
a specific one-off which could be better performance-wise (so if you are making 
a component that's like a progress bar, you'd do this clipping and 
repeat-bitmap drawing in the onDraw() rather than increasing rendertime by 
compositing a separate RoundedImageView and a repeatable BitmapDrawable 
described above).

Rich







-- 



Other Threads

1. Akhirnya Ready Stock :)

Akhirnya datang jugaa :P

Transcend MicroSDHC 8GB - class 6
Spesial buat milis id-android @ 220rb sajah; limited stock (15 pcs only).


Thanks utk atensinya :)

Regards,
Hoesin [Pisang] 
the plaza semanggi lt.2b no.40 & no.77
e: sales @pisangshop.com

-- 
"Indonesian Android Community [id-android]" 

2. Some problems about building OpenCore outside of Android ......

Hi all,

I am a freshman to OpenCore.
I have met some problems when I built OpenCORE outside of Android.

source setup.sh <opencore>
make -j

At the end of the message is a warning.

/usr/bin/ld: warning: libopencore_net_support_debug.so, needed by /
home/yjshi/android-donut/external/opencore/build_config/
opencore_dynamic/build/installed_lib/linux/
libopencore_player_debug.so, not found (try using -rpath or -rpath-
link)

DONE building /home/yjshi/android-donut/external/opencore/build_config/
opencore_dynamic/build/bin/linux/pvplayer_engine_test.
DONE building /home/yjshi/android-donut/external/opencore/build_config/
opencore_dynamic/build/installed_lib/linux/libopencore_rtsp_debug.so.

My first question that why  this warning could happen. How to deal
with it?
________________________________________________________________________

I run 'make run_pe_test TEST_ARGS="-help"' to see the list of valid
<test_args>.
but logs show that:
...
PVLOG:TID(0x409238d0):Time=1121:PVPlayerEngine::TimeoutOccurred()
Timer for PlayStatus event triggered
PVLOG:TID(0x409238d0):Time=1121:PVPlayerEngine::ConvertFromMillisec()
In
PVLOG:TID(0x409238d0):Time=1121:PVPlayerEngine::ConvertFromMillisec()
Out
PVLOG:TID(0x409238d0):Time=2122:PVPlayerEngine::TimeoutOccurred()
Timer for PlayStatus event triggered
PVLOG:TID(0x409238d0):Time=2122:PVPlayerEngine::ConvertFromMillisec()
In
PVLOG:TID(0x409238d0):Time=2122:PVPlayerEngine::ConvertFromMillisec()
Out
PVLOG:TID(0x409238d0):Time=3122:PVPlayerEngine::TimeoutOccurred()
Timer for PlayStatus event triggered
PVLOG:TID(0x409238d0):Time=3122:PVPlayerEngine::ConvertFromMillisec()
In
PVLOG:TID(0x409238d0):Time=3122:PVPlayerEngine::ConvertFromMillisec()
Out
PVLOG:TID(0x409238d0):Time=4124:PVPlayerEngine::TimeoutOccurred()
Timer for PlayStatus event triggered
PVLOG:TID(0x409238d0):Time=4124:PVPlayerEngine::ConvertFromMillisec()
In
PVLOG:TID(0x409238d0):Time=4124:PVPlayerEngine::ConvertFromMillisec()
Out
PVLOG:TID(0x409238d0):Time=5123:PVPlayerEngine::TimeoutOccurred()
Timer for PlayStatus event triggered
PVLOG:TID(0x409238d0):Time=5123:PVPlayerEngine::ConvertFromMillisec()
In
PVLOG:TID(0x409238d0):Time=5123:PVPlayerEngine::ConvertFromMillisec()
Out
...
My second question is whether these information is all right.
___________________________________________________________________


And then I try to run pvplayer_engine_test
pv2way_omx_engine_test      test_pvauthorengine
they are all failed.

~/android-donut/external/opencore/build_config/opencore_dynamic/build/
bin/linux$ ./pvplayer_engine_test

./pvplayer_engine_test: error while loading shared libraries:
libopencore_player_debug.so: cannot open shared object file: No such
file or directory

~/android-donut/external/opencore/build_config/opencore_dynamic/build/
bin/linux$ ./pv2way_omx_engine_test

./pv2way_omx_engine_test: error while loading shared libraries:
libopencore_2way_debug.so: cannot open shared object file: No such
file or directory

~/android-donut/external/opencore/build_config/opencore_dynamic/build/
bin/linux$ ./test_pvauthorengine

./test_pvauthorengine: error while loading shared libraries:
libopencore_author_debug.so: cannot open shared object file: No such
file or directory

My last question is  how to solve this problem.

thanks
yjshi

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Mapping android code

4. 404 returned by Picasa Protocol

5. milestone 2nd lengkap + murah

6. Android market - limited distribution

7. API demo search invoke, received search action by onNewIntent()