Android :: Draw A Circle With Transparent Middle?
Aug 15, 2010
Hopefully this is a simple one as I've been asking loads recently...
I am trying to draw the a white circle with the following code...
but it is being displayed as a solid disk, how do I get it to just display as an circular outline with a transparent centre?
I've had a look in the help and it makes no sense to me, probably because I'm not used to the drawing terms like stroke and dither. What's wrong with background and border eh?
View 2 Replies
Sep 2, 2009
I'm new to openGL and I have done some first tests with drawing a triangle. Now I would like to draw a circle, which is filled with a texture, but I have no idea, how to do so.Can someone of you give me a hint?
View 5 Replies
View Related
Jan 12, 2010
I've created a bitmap that I'm overlaying over another bitmap. I'd like to alter the transparency of sections of the overlaid bitmap, revealing the bitmap beneath. I can't find a way to write only to the alpha channel of the overlaid bitmap.
For example, I have a bitmap filled with red pixels, and an alpha that is 255, opaque. A solid red bitmap. How do I draw a circle on this map that would lower the alpha values toward 0, transparent?
View 2 Replies
View Related
Aug 1, 2009
I've this code:
Java: (http://nopaste.me/4449 )
package com.patrick.games.whackgroundhog; import android.app.Activity;
import android.content.Context; import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Paint;
import android.os.Bundle; import android.view.MotionEvent; import android.view.View;
public class Game extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(new Ground(this));
} class Ground extends View { public Ground(Context context) { super(context);
} public void onDraw(Canvas canvas) { canvas.drawColor(Color.BLACK);
} @Override public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
//TODO: draw the circle } return true;
} } }
View 2 Replies
View Related
Jul 6, 2010
My objective is to run a glowing animation on an image.I am changing the image alpha to produce this effect.
I have used basic AlphaAnimation provided in android framework but found that its slowing down other animations. So i extended a class from SurfaceView and created a thread to update it. ( Again here, i am manipulating alpha of the image ).
Everything seems fine, except that i am not able to draw a transparent image onto SurfaceView.Its showing black color on the transparent areas of the bitmap.code...
View 1 Replies
View Related
Jul 23, 2010
I am working on a paint application for Android. Now I want to implement an eraser to allow erasing parts of a loaded bitmap by using touch input and making the bitmap transparent along the finger's path.
A very good example of what I try to achieve is shown in the application Steamy Window for Android. Steamy Window simulates a fogged window, where a user can wipe parts of the fog via touch input.
UPDATE: I have posted the most important sections of my current code below. I am not really happy with it for the following reasons:
Drawing is quite sluggish. What can I improve here?
I am looking for a way to use an alpha mask in order to set the pixel transparency/alpha of the pixels as I want to simulate a paint brush. Any suggestions how this could be achieved?
CODE:...................
View 1 Replies
View Related
Aug 19, 2009
seems pretty straightforward.
CODE:..............
But doesn't work!
It scrunches the layout background as the background to each button, I want it to span all three buttons...
View 2 Replies
View Related
Jul 9, 2010
I have already found how can I do an ImageButton with Transparent background, but I would like to ask, how can I set the effective of it ?
How can I do it more transparent ?
My way as I do it: <gradient android:startColor="#aaffffff" android:endColor="#aaffffff" ...>
What should I write in to the color to be more transparent ?
View 3 Replies
View Related
Sep 5, 2010
In my android application I use this method in "draw" Overlay class for draw route on map. Can someone tell me if this method is good (in terms of performance) for route draw on map or I must to put code in Thread ??
I'm new to android.
public synchronized void draw(Canvas canvas, MapView mapView, boolean shadow) {
if (pointsAndTimes.isEmpty()) {
return;
}
Projection projection = mapView.getProjection();
Paint paint = new Paint();
paint.setARGB(250, 255, 0, 0);.............
View 1 Replies
View Related
Jul 7, 2009
Is there a way to grow the progress bar from the middle and in both directions? Something like below:
CODE:.............................
View 3 Replies
View Related
Aug 1, 2009
I have a vertical, set height (300px) LinearLayout (LL) with 3 nested LLs. 1 and 3rd are set with android:layout_height="wrap_content" and the middle one with android:layout_height="fill_parent". To my dismay, 3rd LL get's pushed out with 2nd one filling parent layout right to the bottom. How do I achieve desired effect since I want potentially resize the outside container with the middle portion expending and contracting to accommodate the change
View 4 Replies
View Related
May 22, 2009
I have a slideshow function in my app and if the number of images is more, the phone locks (screen goes black) in the middle of the slideshow. How can I avoid this in my app?
View 3 Replies
View Related
Sep 30, 2010
Does someone tell me what is application and middle layer in android. I have to know details these 2 layers and about linux kernal and how is related to android.
View 6 Replies
View Related
Aug 26, 2010
If I create a new arraylist of size 5...
And then I try to add to the middle of that arraylist...orderedPlayers.add(2, P);
I get an indexoutofbounds...I also get indexoutofbounds if I use set instead of add...orderedPlayers.set(2, P);
In fact the only way I can add P to the arraylist is if I use the 0 index...orderedPlayers.add(0, P);
And also for some strange reason when I do that my debugger in eclipse sees that element added to the 4th index of orderedPlayers instead of the 0th... is ArrayList buggy or am I completely missing something? how would I add to the middle of a null ArrayList?
View 7 Replies
View Related
Sep 22, 2010
I am trying to create a Java program that takes the firstname mi last name input and outputs "FI MI lastname".
View 1 Replies
View Related
Nov 17, 2010
I need that my user interface haves 3 sections
NORTH SECTION: four textviews with info about a user MIDDLE SECTION: a googlemap view with the position of the user SOUTH SECTION: a textview with time of last position, and a button to actualice the position (retrieving it from a database)
is this possible? i can't find any information about that on google or android developers guide...
View 8 Replies
View Related
Jan 27, 2009
Is it possible to make TextView to break words in the middle and then move to another line, instead moving whole word that doesn't fit to the new line ? I have a width and number of lines of the TextView and a long string and want to calculate which portion of the String will fit exactly. the code is TextView vTextShort = (TextView) findViewById (R.id.story_text_partial); int lineHeight = vTextShort.getLineHeight(); int nmbLines = mesuredHeight / lineHeight; Paint mPaint = vTextShort.getPaint(); String shortTextStr = mStoryText; mStoryBreakIdx = 0; vTextShort.setLines(nmbLines ); int breakText = mPaint.breakText(mStoryText.toCharArray(), 0, mStoryText.length(), mesuredWidth, null); mStoryBreakIdx = breakText * nmbLines; It seems to calculate number of chars accurately but not accounting for the space that left after word is moved to a new line if it doesn't fit fully. And i'm looking on how to either break words in the middle or how calculate a width of the text that will fit correctly.
View 2 Replies
View Related
Jul 30, 2010
I am having issue while showing a WebView in an activity in the middle of the screen. I have an activity and I want to show a webview in the center of screen. My activity is transparent so background activity will be visible. Whenever I try to create a webview and add it to activity using setContentView(webview) it always shows the view on the top left corner of the screen. Is their a way to workaround this?I am trying to do this via pure code only.
Here is my code.
CODE:....................
View 1 Replies
View Related
Nov 5, 2010
I recently bought an android phone.Samsung galaxy's.I just found out the android market is not available for the middle east ( which i am from ).Is there anyway around this?Rooting? Downloading it from some website over SD card?Or at least can i download android apps from pc and transfer to phone over SD card?
View 7 Replies
View Related
Sep 2, 2010
I have a question that I wanted to put button and circle on the same canvas. How can I do this? Please give reply as soon as possible.
View 2 Replies
View Related
Oct 29, 2010
Trying to draw a circle at a longitude/latitude position. The circle below doesn't show up, does anybody know why?
View 5 Replies
View Related
Mar 16, 2010
I have to recommend just getting a book on the subject.I learned most everything off of examples and documents on the web.After several months, I finally picked up the blue book and everything I had scoured to find is clearly demonstrated in it.Look for the red book and the blue "superbible."They cover everything you need.There are also books specific to ES.Make sure to get a good 1.1 one and not a 2.0-only one.
View 7 Replies
View Related
Jul 14, 2009
I was going through the notepad tutorials .... the cursor was placed in the middle of edit text ..i tried to make the cursor to point in the first line as shown in the pic but not able to find the solution for it...
View 2 Replies
View Related
Mar 5, 2010
I'd like to display a given String in a circle (so bend the string so that the end of the string touches the beginning of the string). And Then I'd like to let the user rotate the circle by grabbing and dragging it clockwise or counterclockwise. Do you guys know what would be the best (simplest, smoothest) way to do this? I already saw that using drawOnPath i can draw text in a circle. Do you have any tips on how to proceed with dragging and rotating the textcircle?
View 8 Replies
View Related
Nov 2, 2010
When I have a status bar notification with a number inside, it shows the number fine. But later if I show another notification to replace this one, with no number, it shows an empty red circle. This circle shouldn't be there. How do I remove the red circle? See image here: http://jump.fm/UYHGV.
View 1 Replies
View Related
Aug 7, 2009
I have a very simple requirement. I have a View object, lets say an ImageView object. I want to move this ImageView object in a circle.
More specifically, I want to move it along an arc, which is not a complete circle. I found in Android Documentation that comes with SDK that we can create a path from an arc but it does not mention how to use this path to make an animation that goes along that path.
Please note that I dont want to rotate the image. I have to move it in a circular path.
View 3 Replies
View Related
Jun 8, 2010
Title says it all. And the battery was fully charged.
View 3 Replies
View Related
Nov 3, 2010
Ive had the evo for about a week, and the operating system seemed to be acting a bit buggy but i put a fix on that real quick. now a persisting issue i have is that there is a line going down the middle of my screen on every page no matter where i go. i didnt have it for about a day or so and it seems to be some kind of seperation or something.
View 7 Replies
View Related
Sep 3, 2010
I feel so much better about my keyboard. I have been using the stock one, but it gives me fits with my man hands and correcting my texts has been a pain in the ass.I finally sat down and researched a lot of keyboards and tried out a bunch on my Stock 2.2 Evo.Anyway, the keyboards on the marketplace are crap. They promise tons of options, but work as well as the stock keyboard. Then I heard about the Droid X keyboard, and spent about 2 hours installing and playing with different versions before discovering that they didn't run on 2.2I finally found one here that worked perfectly. It is amazing.
View 9 Replies
View Related
Aug 4, 2010
Screen has a dead zone right in the middle of the screen. The pictures show exactly where this zone is located. Should I get another one? This is my first EVO. This issue appears to have started last week. Running Android 2.2.
View 3 Replies
View Related