I've not done this before, but I believe you could create a new Canvas
object, and call the draw() method on your parent activity, passing in
your temp canvas object as the target:

http://developer.android.com/reference/android/view/View.html#draw%28android.graphics.Canvas%29

Something similar to this:

Canvas tempCanvas = new Canvas();
this.draw(tempCanvas);
Bitmap screenshot = tempCanvas.drawBitmap(...)

After that, you should be able to call drawBitmap()  on the canvas,
and it will produce a "screenshiot" of everything inside that
activity.




On Mon, Sep 7, 2009 at 9:29 AM, Ajeet Singh<[email protected]> wrote:
>
> Actually I want to take screen-shot of what is shown on the screen as
> well as beyond it also like in case if scroll bar are present.
>
> There is one function getDrawingCache() which does that, but it only
> save picture what is available on the screen. It does not capture
> beyond screen if the picture is big.
>
> If some body knows then plz reply.
>
> Anyway, i will post this question to android-developer forum.
>
> Thanks gjs for your quick reply.
>
> Ajeet
>
>
>
> On Sep 7, 12:22 pm, gjs <[email protected]> wrote:
>> And this question is probably better asked in the developers group.
>>
>> http://groups.google.com/group/android-developers
>>
>> On Sep 7, 5:11 pm, gjs <[email protected]> wrote:
>>
>> > Hi,
>>
>> > Have a look at View.draw(Canvas canvas) in the 
>> > docshttp://developer.android.com/reference/android/view/View.html
>>
>> > Create a Bitmap of an appropriate size and a Canvas which uses the
>> > Bitmap, call View.draw(canvas) - using your view - then save the
>> > Bitmap to file in whatever format jpg, png etc.
>>
>> > It works for most but not all types of  views.
>>
>> > Regards
>>
>> > On Sep 7, 2:42 pm, Ajeet Singh <[email protected]> wrote:
>>
>> > > I want to use screenshot kind of application in my own application. So
>> > > that I can take picture in any format and save it.
>>
>> > > Can anybody give me hint what to use and how to start?
>>
>> > > Thanks in advance,
>> > > Ajeet
>>
>>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to