http://developer.android.com/guide/topics/graphics/index.html#draw-with-canvas

I think you next need to display your canvas.  It does not appear to
be attached to your view hierarchy, that I can see.  You setContetView
main, but I don't see you attach to any views.

On Dec 3, 9:37 am, Neilz <neilhorn...@googlemail.com> wrote:
> I would have guessed that your drawing needs to be done within the
> draw (or onDraw()?) method, which you have to overide. I'm not sure if
> drawing from another method has any effect, but even if it does it is
> probably being 'overdrawn' when the real draw method is called.
>
> Check out SDK samples for use of onDraw();
>
> Someone probably has a better explanation than this...
>
> On Dec 3, 6:10 am, Joe Momma <joemommas...@gmail.com> wrote:
>
> > Eventually I would like to try to port a code I found here:
>
> >http://bodytag.org/tp02/
>
> > I am very new to this though, and I can't even load my image to
> > display.  What I have so far is below, but it doesn't show anything
> > when I run it.  What am I doing wrong?
>
> > Also once I have this loaded will this image be able to be manipulated
> > the way I want to?
>
> > Any help would be appreciated.
>
> > public class Ripple extends Activity {
>
> >     LinearLayout mLinearLayout;
> > //    View mView;
>
> >     /** Called when the activity is first created. */
> >     @Override
> >     public void onCreate(Bundle savedInstanceState)
> >     {
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.main);
>
> >         loadImage();
> >     }
>
> >     public void loadImage () {
> >       Paint mPaint;
> >       Canvas mCanvas;
> >       mPaint = new Paint();
> >       mCanvas = new Canvas();
>
> >       Bitmap baseImage = BitmapFactory.decodeResource(getResources(),
> > R.drawable.my_image);
>
> >       mCanvas.drawBitmap(baseImage, 0, 0, null);
> >       Log.i("draw","Drew");
>
> >     }
>
> > }
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to