Move A Path With A Repeating Bitmap Image In Droid

I'm currently writing an android side-scrolling game and am having trouble filling a path with a repeating bitmap image. I'm creating a path from a number of coordinates to make up the "ground" area. I have a character who is fixed in the middle of the canvas and screen and am moving the path to represent the movement of the character. I've been able to fill the path with a repeating image using a bitmapshader. Also i can move the path shape from side to side on the screen. However, the bitmapshader seems to be using a default origin of 0, 0 which means the shader is always drawing the ground repeating image in the same place. This means that even though the path is moving the ground repeated image never appears to move. Does anyone have any idea how to change the origin of the shader or know of a better way to fill the path with a repeating image?

Alternatively, can anyone suggest a better solution for filling a drawable shape with an image?

View Full Post With 2 Replies

Related Forum Messages:

Please Follow Index to Quick Jump to the Message.

Tile Bitmap - Bitmap As A Background Image In App

I'm trying to load a bitmap in android which i want to tile. I'm currently using the following in my view to display a bitmap: canvas. Drawbitmap(bitmap, srcrect, destrect, null)

I essentially want to use this bitmap as a background image in my app and would like to repeat the bitmap in both the x and y directions.

I've seen the tilemode. Repeat constant for the bitmapshader class but am unsure if this is to do with repeating he actual bitmap or to do with applying a filter to the bitmap.

Posted On: Aug 21 09 at 9:56 . View Related Posts . . View 4 Replies .

Unable To Access Pixels Of A Bitmap Image On Droid / Solution For It

In short i am unable to access all the pixels of a bitmap image.

I have used an intent to fire the native camera app and returned a bitmap image to my application activity. The data is definitely a bitmap object and i am able to display, get the height/width etc and access some pixels using getpixel(). However when i use the values of getheight() and getwidth() i get an array out of bounds error. By trail and error i have found i can only access a reduced number of pixels of the image, for example with one image which returned a height and width value of 420, 380, i could also access 200, 100. I then do some image processing and used setpixel() on the original image. When i display the image it shows the, say 200, 100, processing pixels and the rest normal, therefore the pixels are obviously there and accessible by android but not by me. I have to spoken to other people who have also had this problem with images.

Does anyone know anything more about this, reasons? Or a work around?

Posted On: Nov 20 at 15:04 . View Related Posts . . View 2 Replies .

Part Of My Bitmap Image Missing When Written To External Storage / Why Is So

I want to send an image of a view to external storage so that it can be printed. The view is a grid made up of a tablelayout, tablerows and textviews. I write the view to the sdcard, then copy it to my hd using the ddms file-explorer screen. But when i look at it in ms paint, the image is only partially there.

I have tested this two ways.

When i used the xml version, the result was a small black square " no detail, no grid, nothing.

Next i created a textview programmatically, with text using settext(aaaŁ). The resulting bitmap had the correct color and size, but the text was missing.

Would someone please tell me how to get my view correctly written to external storage so that it looks like it does on the android screen? Code.

Posted On: Nov 10 at 7:00 . View Related Posts . . View 1 Replies .

Draw Map From Textfile Onto Bitmap But Bitmap Is All Black

I'm trying to draw a map from a textfile onto a bitmap, but the bitmap is all black

First i load a textfile that looks like this (shortened):

0000000000 (200 width)
(120 height)

Where "1" is ground and "0" is a wall, 1 should be white and 0 should be black.


Posted On: Oct 12 at 16:05 . View Related Posts . . View 1 Replies .

Is There Fast Way To Check Intersections Of Path

I have two android. Graphics. Path objects and i want to check if they intersect. The only way i found out so far, is to build regions from them and then go through every pixel with.

Posted On: Jun 14 2009 . View Related Posts . . View 2 Replies .

Htc Desire - Songs Repeating With Shuffle On / Fix It

When i play large playlists on shuffle using the standard htc mp3 music app, some songs repeat before each song from the playlist has played. Has anyone else encountered this and if so, have you come up with any remedies?

Posted On: 07-23-2010, 09:48 AM . View Related Posts . . View 3 Replies .

Media - Player That Goes Through Entire Library Before Repeating Any Songs?

Does anyone know of a good music player that shuffles the way it should? I've tried the stock music player on the hero as well as mixzing and both are absolutely awful for playing music. I drive a truck and have hours on the road and keep getting the same songs over and over. Is there a player anyone knows of that goes through the entire library before repeating any songs?

Posted On: 04-10-2010, 08:23 AM . View Related Posts . . View 6 Replies .

Motorola Milestone - Gallery And Music Can't Be Browsed To Through A Path

How is it that things like the gallery and music can't be browsed to through a path? I don't want all folders showing up in my gallery, or all my music and i also don't want to select something folder by folder when i could instead select one folder and include all its sub-folders (haven't found this option).

Other than this. I love having switched over to android with my lovely milestone.

Posted On: 10-28-2010, 04:15 PM . View Related Posts . . View 3 Replies .

Motorola Droid X - Move From Old Root To New

Hey all, i've been super busy lately so i haven't had time to dive into the new updates for my x. I rooted my phone originally using the 1 click method and i am running flyx and the leaked froyo.

My questions are:

Should i move to "upgrade" to the new stuff?
Is there a special way to go from the "old" root to the "new" root?
What is the best "new" root way? (Thinking of using this: one click droid x froyo roooot gui! - Droid x rooting - alldroid public board - one click droid x froyo roooot gui! - Droid x rooting - alldroid public board - > home)
Any detailed instructions and/or links would be greatly appreciated, as i am a bit out of the loop for now.

Posted On: 10-21-2010, 11:31 AM . View Related Posts . . View 10 Replies .

Motorola Droid X - How To Move Widget From One Screen To Another

1. Once something has been trashed, is there a way to "untrash" and/or restore it?
2. How do i move a widget from one screen to another?
3. When my phone is connected to wifi, does it automatically use wifi for data transfer (so i'm not using up my vzw data allocation)?
4. I have a "news feed" widget on one of my screens. I know i saw this setting somewhere, but can't seem to find it again - is there a way i can kill the news feed? (I don't want to use up my data allocation on useless news feeds. )
5. I just took a look at all of my "running services. " Some of them i don't need or want (and they waste battery power and data allocation). Is there a way to set which programs run at start-up, and which have to be manually launched?

Posted On: 09-02-2010, 03:34 PM . View Related Posts . . View 3 Replies .

Display A Bitmap In A Editbox In Droid

I have two bitmap images . And i need to merge the bitmaps with precise positioning of one bitmap over other and get a resultant bitmap (which is combination of both)

And the resultant bitmap is a font character and i want that bitmap to be displayed in a edit box where i am inputting text.

Posted On: Jul 30 at 5:43 . View Related Posts . . View 1 Replies .

Convert Bitmap To Sepia In Droid

Is there any way to convert a bitmap to sepia?
I know to convert to grayscale is to set the setsaturation in colormatrix.
But what about sepia?

Posted On: Nov 10 at 4:09 . View Related Posts . . View 1 Replies .

Stamp Bitmap Along A Line In Droid

Is there any easy way to stamp bitmaps along a line in android? I've found the pathdashpatheffect class but that only allows paths to be stamped, rather than bitmaps. It seems like it should be possible, but i'm not sure where to start.

I could obviously just draw bitmaps along the line, but it seems to me like that would be a bit more resource intensive, especially because i would not be doing it in native code.

Any help or suggestions?

Posted On: Aug 8 at 3:23 . View Related Posts . . View 1 Replies .

Motorola Droid - Pointer In Screen When Trying To Copy / Paste - Move It

I saw a mouse pointer appear briefly in the screen when trying to copy/paste (unsuccessfully, this needs big improvement!). I could not get it to move. Is this something that will be implemented in the future? Is the center select area on the directional key also capable of moving a pointer like a trackpad? If so this would make this phone infinitely more useable when web browsing and using email.

Posted On: Nov 20, 2009 9:26 AM . View Related Posts . . View 1 Replies .

Render Text Over A 48x48 Bitmap In Droid App

I'd like to know how can i render a text over a 48x48 bitmap in my android application, considering sometimes the text exceeds the bitmap width . In such cases i need to render only a part of the text followed by dots such that all fits the available width .code.

Posted On: Oct 18 at 5:41 . View Related Posts . . View 1 Replies .

Motorola Droid - Move A Movie From My Laptop (avi File) To X - Tutorial For It

How do i move a movie from my laptop (avi file) to the x, maybe a tutorial for the complete idiot ? (Step by step)
I hooked up my x to my laptop with a usb cable, drivers were downloaded and thats all that happened.
Do i need a program on my laptop ? Someway to "see" the phone on the laptop and then how to move a movie in avi format?

Posted On: 07-20-2010, 12:17 PM . View Related Posts . . View 12 Replies .

Unable To Display Complete Bitmap In Droid Using Canvas / Get Full To Show

I am using following ondraw method to display bitmap on screen.code.

Image is displayed on the screen but some part because android screen is small
How can i display complete image in whole android screen?

Can i set scaletype of image to fitxy in canvas ?


Can i add android layout image to this canvas so that i could set fitxy property or image there as i have commented the code?

Posted On: Jun 10 at 9:47 . View Related Posts . . View 2 Replies .

Unable To Click On Regions Of 1st Image Where 2nd Image Overlapping / How To Do

I have 2 imageviews which have animationdrawable backgrounds to animate a box opening and closing when you click on it. The 2 images are slightly overlapping (the transparent area) so they can be closer together.

The problem this is causing is that i am unable to click on regions of the 1st image where the 2nd image (transparent area) is overlapping.

Is there a way to set a clickable region of an imageview?

Posted On: Aug 13 at 9:02 . View Related Posts . . View 1 Replies .

Motorola Droid - How To Move Photo Contained In Text Message To Photo Gallery

Droid by motorola w/verizon:how can you move a photo contained in a text message to the photo gallery?

Posted On: Jul 28, 2010 8:04 PM . View Related Posts . . View 1 Replies .

Custom Image For Handcent - Droid X

Has anyone successfully got a custom backround to look good? No matter where i move the frame to select what part of the pic i want it always gets blown up too big and looks like crap. Anyone know how to get this to work?

Posted On: 07-28-2010, 09:43 AM . View Related Posts . . View 1 Replies .

Program An Image Chooser In Droid

I would like to program a image picker which should choose an image from the library. Is it possible to do this in a smooth way with the android sdk? I'm pretty new to android programming.

Posted On: Jun 26 at 11:30 . View Related Posts . . View 2 Replies .

Lg Optimus - Cannot Move Icon

I accidentally moved an icon app (hangman) on top of my text icon on the bottom of my screen and can't move it. I uninstalled the app, but it only removed the original, not the shortcut, which is now over my text icon (which won't work now).

Posted On: 2011-02-05 . View Related Posts . . View 1 Replies .

Motorola Droid - Possible To Have Different Image On Lock Screen

Is it possible to have a different image on the lock screen?

Also what is:
2. 0 lock screen with vibrate tweak patcher i have seen in pete's bb threads?

How is the 2. 0 lock screen different then the one in bb 1. 1?

Posted On: 02-28-2010, 10:29 PM . View Related Posts . . View 1 Replies .

Motorola Droid - Launcher With Different Image For Each Screen

Does anyone know of a method/launcher that allows you to have a different wallpaper image for each screen?

Also, if that's not possible, is there a way or a launcher with the option to lock the wallpaper so that it doesn't slide when going from screen to screen?

Posted On: 06-15-2010, 03:29 PM . View Related Posts . . View 12 Replies .

How To Do Fade-in Of An Image On Droid Activity Screen

I'd like to display a photo on an android activity screen with doing gradual and continual fade-in from pale monotone sepia to the final full color. I know how to do it on a java image/bufferedimage for the graphic object but unfortunately i know nothing for the android programming environment.

Posted On: Apr 8 at 3:03 . View Related Posts . . View 2 Replies .

Image Orientation Issue On Motorola Droid

Our app uses the gallery pick action to grab an image from the device to upload to a new blog post. We're seeing on the moto droid that images taken in portrait are being sent back to the app in landscape orientation so the image is sideways. Afaik this only occurs on the droid.

Found this via google, but we need the full size image to be uploaded in the correct orientation so the solution doesn't work for us:

An easy way to reproduce this is to take a picture in portrait on the droid, then send it to yourself via gmail. In the email message, the image will be in landscape (sideways). I've tested on the droid 2. 1 update and the issue is still there.

Here's some more info:

I took a peek at the image info in photoshop, and it has this line:


This spec [url] says that the value of 1 is: 1 = the 0th row represents the visual top of the image, and the 0th column represents the visual left-hand side.

In this case, isn't that incorrect? The top of the image in my case is the right side, with the 0th row being the left side, which i think should be a value of '5' for the tiff orientation.

Posted On: Apr 5 at 22:05 . View Related Posts . . View 1 Replies .

Get Bitmap From An Uri

How to get bitmap object from an uri (i suppose i succeed to store it in /data/data/myfolder/myimage.png or file///data/data/myfolder/myimage.png i used both path) to use it in my application. But i failed to get it.

Posted On: Oct 7 at 8:43 . View Related Posts . . View 1 Replies .

Button Over Bitmap

I am a beginner android developer and i am trying to have a button display on top of the bitmaps i am outputting.

Here is what i have:

My activity sets this:


Main.xml is framelayout that i stuck a button on top of, that's it.

I guess my question is, how do i insert something into the main.xml as a "canvas" in order to paste my bitmaps to, but still have the button always on top regardless of how many bitmaps i draw?

Posted On: Oct 1 at 13:32 . View Related Posts . . View 1 Replies .

Use Keypad - Left And Right - To Move From One Tabhost To Another

Is it possible to use the keypad (left and right) to move from one tabhost to another? I successfully changed the selector color in listview, then how can i change the text color in listview as well? Is it possible change the tabhost layout by own graphics? I have created a tabhost aligned to the bottom of the screen. How can i move the "line" on bottom of tabwidget to above? (See screenshot)

Posted On: Aug 6 at 10:29 . View Related Posts . . View 1 Replies .