Closed Dani-error closed 11 months ago
I want to know how to save a screenshot that I taked... This is my code:
ReadOnlyCollection<string> udids; int count = 0; var idevice = LibiMobileDevice.Instance.iDevice; idevice.idevice_get_device_list(out udids, ref count); if (count == 0) { return; } string udid = udids[0]; idevice.idevice_new(out deviceHandle, udid).ThrowOnError(); var springboard = LibiMobileDevice.Instance.SpringBoardServices; SpringBoardServicesClientHandle springboardServices; springboard.sbservices_client_start_service(deviceHandle, out springboardServices, "Orbit"); IntPtr imgData = IntPtr.Zero; ulong imgSize = 0; springboard.sbservices_get_home_screen_wallpaper_pngdata(springboardServices, ref imgData, ref imgSize); Console.WriteLine(imgData + " " + imgSize); deviceHandle.Dispose(); springboardServices.Dispose();
But I don't know how to save the IntPtr...
byte[] managedArray = new byte[imgsize]; Marshal.Copy(imgdata, managedArray, 0, (int)imgsize); File.WriteAllBytes(Path.Combine(path, filename), managedArray);
I want to know how to save a screenshot that I taked... This is my code:
But I don't know how to save the IntPtr...