Is it possible remove HTML elements (radar) and other drawables.cam from the screen before the snapshot without doing it manually? Maybe do a function exist?
A
Andreas Schacherbauer
said
almost 10 years ago
Hi luca, You can exclude the webview from the screen shot. The API for all platfrom offers an additional parameter to do so. Please refer to the documentation for more information. Please also have a look at our SDK example app which includes a sample that takes a screen shot and saves it to the device photo library.
iOS: captureScreenWithMode:usingSaveMode:saveOptions:context: Triggers the generation of a UIImage which contains a screenshot of the next available frame.
captureMode: Defines if the WebView is included in the screenshot or not.
saveMode: Defines how the captured screenshot should be processed. Possible ways are to save it to the Photo Library, to a specific bundle directory or to receive a delegate call where the image is passed in.
options: Defines more option for a specific SaveMode.
context: A NSDictionary containing information about the CaptureMode, SaveMode and SaveMode specific objects. See Protocol reference for more information.
captures currently visible screen and passes callback picture as Bitmap
Parameters: captureMode - as in CaptureScreenCallback.CAPTURE_MODE_* callback - callback to invoke once bitmap is ready (may take some milli-seconds) Throws: IllegalArgumentException
PhoneGap: captureScreen Use this function to generate a screenshot from the current Wikitude SDK view. @param {bool} includeWebView: Indicates if the ARchitect web view should be included in the generated screenshot or not. @param {string} imagePathInBundleorNullForPhotoLibrary: If a file path or file name is given, the generated screenshot will be saved in the application bundle. Passing null will save the photo in the device photo library. @param {function} onCapturedScreen: A function that is called when the screen could be successfully captured. The bundle path is passed to the function when the photo was saved into the application bundle. @param {function} onErrorCapturedScreen: A function that is called when an error occurred during screen capturing.
Titanium: captureScreen Use this function to generate a screenshot from the current Wikitude SDK view. @param {bool} includeWebView: Indicates if the ARchitect web view should be included in the generated screenshot or not. @param {string} imagePathInBundleorNullForPhotoLibrary: If a file path or file name is given, the generated screenshot will be saved in the application bundle. Passing null will save the photo in the device photo library. @param {function} onSuccess: A function that is called when the screen could be successfully captured. The bundle path is passed to the function when the photo was saved into the application bundle. @param {function} onError: A function that is called when an error occurred during screen capturing.
Sorry, maybe I did not explain well. I know how I can do a snapshot with wikitude captureScreen method (iOS), but before doing this, I want to remove POI and radar from the screen so they will not appear in the image.
For example, I activate the 3D model and I want to see also POIs and radar. But when I do the snapshot I wanto to see in the saved image only the 3D model...
To do this I have to hide manually al the things and then make them appear again? Or is there something already done?
A
Andreas Schacherbauer
said
almost 10 years ago
Sorry, I misunderstood you. You need to manually hide the Radar and all of your POIs before taking the screenshot. There is no build in functionality for that.
Best regards
Andreas
L
Luca
said
almost 10 years ago
Ok thanks Andreas.
There is a method or an object that I can iterate to inspect elements one on one? (in JS)
A
Andreas Schacherbauer
said
almost 10 years ago
Hi Luca, You get the cam, radar or inidcator drawables from each GeoObject or Trackable2DObject but you need to keep your own list of those created GeoObjects & Trackable2DObjects.
var geoObject = new AR.GeoObject(...); var geoObjectCamDrawables = geoObject.drawables.cam;
var trackable = new AR.Trackable2DObject(...); var trackableCamDrawables = trackable.drawables.cam;
Luca