[Q] easiest way to draw a sprite - Android Software Development

whats the easiest way to draw a sprite or paste a png image that has x, y coordinates?

Pull the png in as a Bitmap object, and then draw the bitmap onto a Canvas.

Related

Xperia icons for SPB Phone Suite

I'm spb phone suite addicted and I made xperia icons for profiles + new custom icon for wireless indicator.
Just install spb phone suite and overwrite .dat files in program directory
They looks better with dark bakground but should be ok anyway, feel free to edit but SHARE your creations
In case you want to edit, rename .dat to .zip and unpack with password "59s04bzq" (without quotes). Edit, save as bmp in R5G6B5 format and repack with same password
in attachments, preview (poor and ugly, look sharper when in place) and dat files
nice work.
I would like to edit n share some of my work..but i lam a ittle lost at this part "save as bmp in R5G6B5 format and repack with same password " all i would really like to do is make the indicators more finger friendly and maybe some color change.s for right now and hopefully some new icons...i would really appreciate it if u could help me out ...willing to learn
..thank you
How do you make the black backgroud images in photoshop ?
I have done my own set of icons but they always come out black.
Saved all as .bmp in the correct colours and sizes too.

[HELP] Animated GIF in WinMo6 or 6.5

I need some help and/or sample code to get an animated GIF into a win mobile .net cf 2.0 coded form.
I am trying to use the picture box, but it will not display the animation, only the last frame of the GIF.
Worst case, if someone could point me to vb.net sample of how to extract the GIF Frames to display them as static bitmaps using a timer function (basically, reconstruction of the GIF by way of BITMAP).
Thanks.

[Q] Custom View question

Apparently XDA thinks my code is a link to an outside website ??? so it's attached in a .txt
Here's my problem. I finally figured out how to get my custom view
working, but discovered that "canvas.drawCircle(..)" draws based on
the screens dimensions and not the bitmap drawn to the canvas (I may be
misusing some terms/concepts here, still a little iffy on the whole
custom view).
Basically, I have a bitmap of a map image (decoded from a .jpg resource), and I want to be able to draw relative to the bitmap's pixel dimensions, and to the bitmap if possible, so that when it's panned/zoomed, it stays in its respective
place. Here is the code for my custom view. I x'd out my latitude and
longitude. The touch handling is code adapted from a Hello, Android
(3e) excerpt.
I'm currently working with "MAP" mode, but it will also come into
play for NAV. But I basically need to draw relative to the bitmap, which is
scaled and manipulated through the canvas(?) so that the current
location dot will stay in the same spot when the bitmap is panned or
zoomed, instead of staying in a static location based on the screen's
dimensions. Any advice?
-Mike

[Q] creating a bitmap

how do I create a bitmap from a png image?
This turns a png into a bitmap:
Bitmap bmp = BitmapFactory.decodeResource(activity.getResources(), R.drawable.myPNGimage);
I think your other post asked about drawing images onto the screen. To do this, you need an object that you want to "draw onto".
So in this example, lets say you want to draw "bmp" onto "backgroundBmp". (Pretend "backgroundBmp" is a 400x400 pixel image)
Canvas canvas = new Canvas(backgroundBmp); // This creates a canvas to work with, thats the size of backgroundBmp (400x400)
Now I can draw a bitmap onto it, by doing:
canvas.drawBitmap(bmp, x, y, null); // This draws bmp at (x,y) coordinates on the canvas.
Take a look at the Lunar Lander and Jet Boy sample applications at developer.android.com.

Ball game - chaning ball position

I am making simple ball game and l have problem.I can't change position of Ball. I tried:
1. SetX() and setY() but lower APIs aren't supported.
2. Params and margins but when I move it left or right, the whole activity content is moving with it. Up and down moving is working fine. (Activity will have 10 ImageViews)
3. Android animations - Problem is that I can't get coorinates (getLeft(), getTop()) during the animation.
4. Canvas and draw elements - I change position of image with onDraw() and invalidate() functions but when I but backgorund and all other images (as bitmaps) it is very slow.
Can you give to me any ideas or suggestions? Thanks in advance.
Can you post the code? What do you exactly want to be done, there can be many different "ball games". You want to change the position of a bitmap or circle on the screen create x and y variables, draw bitmap or circle using them and if they change, the object will be drawn elsewhere

Categories

Resources