Android :: Not Able To Draw A Transparent Image On Surface View / Fix It?

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...

Android :: Not able to Draw a transparent image on surface view / fix it?


Android :: How To Draw Overlay On Surface View Used By Camera?

May 29, 2010

I have a simple program that draws the preview of the Camera into a SurfaceView. What I'm trying to do is using the onPreviewFrame method, which is invoked each time a new frame is drawn into the SurfaceView, in order to execute the invalidate method which is supposed to invoke the onDraw method. In fact, the onDraw method is being invoked, but nothing there is being printed (I guess the camera preview is overwriting the text I'm trying to draw).

This is a simplify version of the SurfaceView subclass I have:

public class Superficie extends SurfaceView implements SurfaceHolder.Callback {
SurfaceHolder mHolder; public Camera camera; Superficie(Context context) { super(context);
mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
} public void surfaceCreated(final SurfaceHolder holder) { camera = Camera.open();
try { camera.setPreviewDisplay(holder); camera.setPreviewCallback(new PreviewCallback() {
public void onPreviewFrame(byte[] data, Camera arg1) { invalidar();
} } ); } catch (IOException e) {} } public void invalidar(){ invalidate(); }
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
Camera.Parameters parameters = camera.getParameters(); parameters.setPreviewSize(w, h);
camera.setParameters(parameters); camera.startPreview(); }
@Override public void draw(Canvas canvas) { super.draw(canvas);
// nothing gets drawn :( Paint p = new Paint(Color.RED);
canvas.drawText("PREVIEW", canvas.getWidth() / 2, canvas.getHeight() / 2, p);
} }

View 1 Replies View Related

Android :: Surface View Draw Images Overlay On Camera Preview

Aug 23, 2010

I have a SurfaceView that is being used to draw images, and I would like to overlay them onto a live-feed from the phone's camera. Currently, the SurfaceView that contains the images have a white-background, but if I were to overlay them onto the phone's camera feed, they would have to be transparent. The camera and animation drawing cannot be done on the same SurfaceView. What is the best course to pursue the use of multiple views that involve managing the camera and drawing images? Is it possible to make a SurfaceView transparent?

View 4 Replies View Related

Android :: How To Add Image On Surface View?

Aug 29, 2009

I am trying to add an image on surface view. I have coded...

View 5 Replies View Related

Droid :: How To Create Blur Surface From Android.view.Surface?

Jan 22, 2009

How do I create blur surface from android.view.Surface?

View 2 Replies View Related

Android :: Draw A View On Top Of Image?

Aug 9, 2010

How do I draw a view on top of image. There is a predefined android xml file and when I run the application I would like to bring up a dot or a square on the top of image. Here the image already shows up from pulling information from andrid res folder , how to draw an dot over it.

View 2 Replies View Related

Android :: Transparent Image Button - Can Be More Transparent

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

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 View Related

Android :: Draw Transparent Lines On Bitmap Via Touch Input

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

Android :: Possible To Start Surface View With Game Thread

Aug 7, 2010

I've read several example programs and tutorials to try and solve my problem but they all seem to go the same way. I've used a couple Activities and xml documents to create a menu that loads when my game starts.When the user clicks the "Start The Game" button, it loads a new Activity that sets the view with my game thread and all of the game properties.I know this activity works because I've run it alone as its own project, but every way I've tried to start it after the Menu,I get a nullPointerException and it force closes.I read the SurfaceViewOverlay tutorial and attempted to use that implementation, but I'm using a SurfaceView, not a GLSurfaceView.I'm debating rewriting my entire program to use OpenGL but I figured I would see if anyone else knows what I'm doing wrong here.If you need the code snippets I can paste some here, but it's not really the specific code that's wrong.

View 1 Replies View Related

Android :: Way To Change Size Of Surface View On Phone?

Nov 11, 2010

I want to change the size of surface view at run time when it is changed to Landscape Mode?

View 1 Replies View Related

Android :: GL Surface View GlText Image2D GlDrawTexiOES

May 3, 2010

I'm trying to render a 640x480 RGB565 image using OpenGL ES on Android using GLSurfaceView and Native C code. Initially I had a 0x0501 error with glTexImage2D, which I was able to resolve by changing the image dimensions. But now, in the "drawFrame" call, when I do glDrawTexiOES to resnder the texture, I'm getting the following error on the Logs: drawtex.c:89: DrawTexture: No textures enabled I'm already doing glEnable(GL_TEXTURE_2D), is there anything else I should do? Is there a complete example showing GLSurfaceView with native code using textures?

View 4 Replies View Related

Android :: Open GL Surface View Renders Black On First Start

Apr 1, 2009

I have an Activity that was created based on the TriangleRenderer example. It works flawlessly as a standalone project, but when I use it as the tab of a tabhost there is a problem. At startup the whole activity is just black - I can get touch events and do everything else but it doesnt show anything. When I change the orientation (and therefore recreate the activity) it all works well. Maybe the problem comes from the View focus. My SurfaceView is not focused when created inside of the tabhost. I tried to fiddle around with the methods available in my onCreate() and onPostCreate(), but couldnt find a way to get the SurfaceView focused. The following sourcecode blocks in the guardedRun() method because needToWait() is true because !mHasFocus is true. If I exclude the ! mHasFocus, it goes on but shows a black View anyways. Do you have any idea why it does work after orientation change, but not at the first startup? The Activity looks quite simple.

View 2 Replies View Related

Android :: Overlay Images Onto Camera Preview Surface View

Aug 23, 2010

I have a SurfaceView that is being used to draw custom animations and I would like to overlay them onto a live-feed from the phone's camera. Currently, the SurfaceView that contains the animations has a white- background, but if I were to overlay them onto the phone's camera feed, they would have to be transparent. The camera and animation drawing cannot be done on the same SurfaceView. Is it possible to make a SurfaceView transparent? What is the best course to pursue the use of multiple views? My end goal is to essentially overlay the contents of another SurfaceView onto the Camera SurfaceView.

View 2 Replies View Related

Android :: Possible To Start Surface View With Game Thread Anytime / Other Than At Startup Of Program?

Aug 7, 2010

I've read several example programs and tutorials to try and solve my problem but they all seem to go the same way.I've used a couple Activities and xml documents to create a menu that loads when my game starts. When the user clicks the "Start The Game" button, it loads a new Activity that sets the view with my game thread and all of the game properties.I know this activity works because I've run it alone as its own project, but every way I've tried to start it after the Menu, I get a nullPointerException and it force closes.I read the SurfaceViewOverlay tutorial and attempted to use that implementation, but I'm using a SurfaceView, not a GLSurfaceView. I'm debating rewriting my entire program to use OpenGL but I figured I would see if anyone else knows what I'm doing wrong here.If you need the code snippets I can paste some here, but it's not really the specific code that's wrong, I think it's the way I'm using(abusing) the language.

View 1 Replies View Related

Android :: Reverse Image Load Order - Loading Animation In A Image View While The Real Image Is Loaded?

Jul 21, 2010

I use http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012 to load images in a ListView and a GridView. It works but the images are loaded form bpttom to top. How to fix that?

Bonus Question: Can I use a loading animation in a image view while the real image is loaded? Right now it's just a default image.

View 1 Replies View Related

Android :: Make Some Part Of An Image Transparent?

Aug 28, 2009

I have a scenario at hand, for which I need a solution as soons as possible. Here is the problem statement: I need to show an image overlapped by some other image, 100%. The condition is that the picture in background should also be visible through the foreground picture but only through some part of the foreground picture. Please try to visualise how it should look like. There is a picture shown and in middle of it, there is a transparent area through which the background image is visible. I knew that I can make an image transparent and make the background image visible but here I want only some part of the foreground image to be transparent so that it looks like sort of picture frame applied to the background puicture. And for those who read the statement carefully would have understood that the ultimate thing desired is to have a picture frame applied to the picture. Can anyone please suggest a good way to do this.

View 2 Replies View Related

Android :: Make Image Opaque / Transparent?

Nov 30, 2009

I would like to place an image over a surface view. However I would like the image to be transparent so you can see the image and also the underlying surface view. Can anyone suggest how I could do this?

View 3 Replies View Related

Android :: Make Transparent Line Appear Over An Image?

Nov 19, 2010

I have an image of a map. I want to draw lines over that image.I have successfully displayed both the line and the image. But , the line is not transparently appearing over the image. The image is only displayed when i run the program. But,if i change the coordinates of the line so that it doesn't overlap with the image,the line is getting displayed.

Pls tell me what i should do to make the line transparent so that both the image and the line are getting displayed.

View 2 Replies View Related

Android :: Application Background Image With Transparent Activities

Oct 29, 2010

I have run into an requirement of my application that i cant find a way to do this.

I need my application to be fullscreen and no title bar (done), and this application will have a background image. However, all the activities/views of my application must be transparent/translucent so the application background will be visible all the time behind the information i am displaying.

Basically i would like to have this behavior

http://www.geeky-gadgets.com/wp-content/uploads/2010/05/amazon-kindle-android-app.jpg

supousing that the image you see is not the phone wallpaper, but the application background image. What would be the application configuration in the manifest file and what would be the configuration for eacy activity/view?

I also noticed that, i need to setup each activity to be fullscreen without title bar. Is there a way to do this globaly in the application so all activities will behave this way?

View 1 Replies View Related

Android :: Find Co-ordinates Of Transparent Area Of An .png Image?

Mar 29, 2010

In my application I use an image . I made some portion of the image transparent. Now How can I find the co-ordinates of the transparent portion of the image so that I am able to find the actual area of the non-transparent area.. I want some methodical way to find.

View 1 Replies View Related

Android :: Access APIs Android View Surface.cpp From My Native Code

Oct 5, 2010

I am working on video renderer application which need surface and control of surface. And through isurface i can register heap buffer to that surface and post buffer operation. I have gone through android_view_surface.cpp file. It is having all required APIs which are helpful for my application. But i don't know how can i implement it. What are the procedures to get access of those APIs.

View 2 Replies View Related

Android :: Lunar Lander Make Image Backgrounds Transparent?

Mar 9, 2010

I'm trying to make a GUI program with the Android SDK, using their Lunar Lander example as a significant self-teaching tool in the process. I've noticed their sprites' images' backgrounds, which were at least usually pure white, did not show up in their program. I want to ask how they did that, since their site doesn't explain simple things very well. I've managed to pull that off before on another GUI SDK, wherein all I had to do was to call a function and pass it a few floats to define a certain color, and until my code told it to do otherwise, that function would make sure that that particular color in my sprites' images was totally transparent. However I've wrestled with the Lunar Lander example and getting my own program to show some custom graphics for a week or two now, and I haven't noticed any such function call in the Lunar Lander example. I tried to look for it, but I did not find anything. I've tried to Google some tutorial or other reference material, but what I've found so far is just straying off into unrelated areas and totally dodging this EXTREMELY important lesson on the SDK's basics.

View 2 Replies View Related

Android :: Make Overlaid Image Transparent On Touch In Droid?

Jun 11, 2010

Making the touched areas of bitmap image transparent(seems like erasing) while I am moving my finger on that image.

I am having a PNG file with Alpha channel in it. I want to turn the touched pixels to transparent so that, the user can feel that he is actually erasing it.

For this I am using frame layout to load 2 layers. Down layer is for content and upper layer is an Imageview for erasing. I need erase the upper layer when user touch and move his finger on it.

I am not getting how to make it transparent. can anyone please help me in this. If possible please direct me to any sample code, as I am very new to this image processing.

View 2 Replies View Related

Android : Display Image Background - Transparent Text At Particular Location

Oct 6, 2010

I need to display image has background and transparent text at particular location of the image text,here my problem is it display well in some devices and not being proper alignment in larger screens,even i used separate resource file like layout,layout-large,layout-small but in some case it's not working well,i set. Code...

View 1 Replies View Related

Android :: How Can I Use Transparent Or Translucent View Effect?

May 1, 2009

I am a newbie in android UI programming. I want to create a custom SurfaceView for my own renderer. And this view has a transparent/ translucent effect with background. I follow api demo sample code to create TranslucentGLSurfaceViewActivity and TranslucentGLSurfaceView, but render result is blank screen.

View 3 Replies View Related

Android :: Draw A Bitmap Image?

Dec 2, 2009

Any one know about how to draw a bitmap image?...

View 6 Replies View Related

Android :: Draw Png Image And Run Opengl

Mar 14, 2009

Is it possible to draw a png image and then to run opengl operations on it with android? Is this the right forum to ask this? where can i get more information on doing such stuff?

View 2 Replies View Related

Android :: Draw A Spot In The Bitmap Image

Oct 12, 2010

Hints to draw a spot(small filled circle) on a bitmap image.

View 1 Replies View Related

Android : List View Scrolling Issue / Background As Transparent

Mar 3, 2009

I have problem with the List view scrolling. Here I have a list view contains more 50 items. I am setting the list view background as transparent. While scrolling the list view it is showing with black background. Can any one tell me how to remove this black portion?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved