[android-developers] Re: Question about View, Canvas, and Drawable.. --Basics

2008-11-06 Thread Mike Reed

Views - yes

Canvas - you can create your own to draw into a bitmap, but views are  
handed a Canvas on their onDraw() method. For a given drawing pass,  
all of the views (usually) are handed the same Canvas (which points to  
the screen). However, on a subsetquent call to onDraw(), the actual  
Canvas object may be different (even if it also points to the screen).

Drawable - this is an abstraction for something that knows how to draw  
itself inside its bounds. There are lots of subclasses (you can create  
your own), including one that wrapps a Bitmap

Bitmap - this is a basic drawing primitive that can be drawn into a  
Canvas, and/or can be the target of a Canvas. It has basic dimensions  
and a reference to memory for pixels (either the screen or to  
offscreen memory)


On Nov 4, 2008, at 8:42 AM, joshbeck wrote:


Hello all,

Is this correct?

View: The android screen is divided up into views. Views are basic
layout objects.

Canvas: You need to have at least one canvas if you want to do any
drawing. Each
view potentially has its own canvas.

Drawable: ---)This is where my 10:30 bedtime turns into a 2:30 am nap
in the chair before work.)
-What is the difference between a Bitmap and a Drawable?
Can Drawables only be used with ImageView Views?


Thanks for any help.
Josh Beck



--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question about View, Canvas, and Drawable.. --Basics

2008-11-04 Thread joshbeck



I'll go ahead and add this too:

I wrote two programs last night:
   -One added a Drawable to an ImageView Layout.
   -The other used onDraw and invalidate to repeatedly render out
a canvas.

Under what circumstances is the Drawable beneficial is my question I
guess.

Thanks again,
Josh

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---