out of memory error in android...
desktop_brush = GrabDesktop(Nil,{width=400,height=400,x=x,y=y})
DisplayBrush(desktop_brush,0,0,{scalex=2.0,scaley=2.0,smoothscale=True})
grabdesktop is not working in android, is possible use another instruction for capture a piece of the display?
i tried savesnapshot, but i cannot save the captured image to a virtual file, i save it to my hard disk, and is very slow here
grabdesktop error in android
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: grabdesktop error in android
Yes, GrabDesktop() doesn't work on Android because there is no easy way to grab the "desktop" on Android. You can use DisplayBGPicPart() instead, e.g. to copy the display's contents to a brush, just use:
This should do the job.
Code: Select all
CreateBrush(1, w, h)
SelectBrush(1)
DisplayBGPicPart(1, 0, 0, w, h, 0, 0, {Layers = True})
EndSelect
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: grabdesktop error in android
i try your solution, and doesn´t work, i´m using doublebuffer and i need capture an small part of the whole screen, the only solution that i found is
using savesnapshot, but it´s 10 times slower than grabdesktop, i´m using this code, and i cannot use less of 20000 in the size in bytes of the virtualfile or the image is corrupted
vf$ = DefineVirtualFile("virtual.dat",0, 200000, "image.jpg")
EndIf
SaveSnapshot(vf$,#SNAPDISPLAY,#IMGFMT_JPEG,{quality=60})
LoadBrush(19,vf$)
using savesnapshot, but it´s 10 times slower than grabdesktop, i´m using this code, and i cannot use less of 20000 in the size in bytes of the virtualfile or the image is corrupted
vf$ = DefineVirtualFile("virtual.dat",0, 200000, "image.jpg")
EndIf
SaveSnapshot(vf$,#SNAPDISPLAY,#IMGFMT_JPEG,{quality=60})
LoadBrush(19,vf$)
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: grabdesktop error in android
solved, i use your code, but i need enddoubebuffer first, thanks, all is working fast again