ondraw

WinForms Gradient (Image or By Code) - OnDraw Event

Ok so im starting to get stuck into my design and get the style right. My Theme is using a kryptonForm style GUI but kyryptonForms do not not have a pre designed ListView, so im having to build this myself My Application is a messenger system based on XMPP/Jabber so you can guess how i would like my contact list to be designed. i have...

subclassing SurfaceView and overriding onDraw() to change SurfaceView parameters to generate preview of desired size

I have subclassed the SurfaceView and instantiating it in onCreate of the Activity. The preview is generated but the control never enters onDraw() which is overriden in the subclass of SurfaceView. Why is that? class ActivityClass extends Activity{ onCreate(){ mPreview = new Preview(this); setContentView(mPreview); } public void st...

Efficient 2D drawing in Android

Hi everyone, I have searched for quite a few hours and have not been able to find a concise definite andswer to my question. I have an application where I need to draw a sports field (including all pitch lines) to the screen. So far, I have extended the SurfaceView and pretty much copied the rest of the LunarLander demo as well. All the...

Convert Lunar Lander to use Opengl

I modeled my game after the Lunar Lander demo that Google provides, and it uses Canvas and onDraw() methods, but I want to get better performance by using Opengl. How much work is it to convert it to Opengl? Can I just replace the ondraw methods with opengl's texture methods or something? Or do I have to completely recreate the game? C...

passing variables to an outside class.

I split my inner View class from my Main class into its own file. In my main class, I have the view set as an onTouchListener which records user movement into a matrix so it can translate and scale the view. After separating it everything works but im unsure how to pass the matrix to the View for onDraw to update. Any suggestions? Thanks...

Custom Widget using LinearLayout not getting onDraw()

I'm creating a custom widget by extending LinearLayout: public class MyWidget extends LinearLayout { private static Paint PAINT = new Paint(Paint.ANTI_ALIAS_FLAG); static { PAINT.setColor(Color.RED); } public MyWidget(Context context) { this(context, null); } public MyWidget(Context context, Att...

Trying to get the display size of an image in an ImageView

Hello, I'm trying to get the real size of an image displayed in an image view. Actually my image is larger than the screen and the imageview is resizing the image to diplay it. I'm looking for this new size. I've tried to override the onDraw method of the ImageView in a custom view but I'm not getting the correct height and width... p...

Android: draw on a view inside an inflated xml (another view)

I have a small xml file called 'xmlview.xml' which is something like: <tablelayout> <tablerow> <view id="view1" /> I created a class which extends view, and I inflated that xml file and now i have a view obtained due to inflation. xmlView = layoutInflater.inflate(R.layout.xmlview, this); I am wondering is there a way to dr...

why my invoke of Canvas.drawText() just doesn't work

Hi all: I'm writing a class that inherit from TextView, and override its onDraw() method, but in the method, my invoke of canvas.drawText() doesn't seems to work, the code just like below: protected void onDraw(Canvas canvas) { // super.onDraw(canvas); Paint paint = new Paint(); paint.setColor(android.graphics.Color.WHITE...

Draw From Old Canvas - Android

Hey guys, I'm making an App that needs to be able to draw new graphics on top of the last set. This is my current onDraw() method - protected void onDraw(Canvas canvas) { canvas.drawColor(Color.WHITE); if(points.size() > 0) { //do some stuff here - this is all working ok canvas.drawLine(p1.x, p1.y, p2.x, p2....