Change the overlay image live in wikitude? - wikitude

Is it possible to change the overlay image after a certain time or period with using the WikiTude ImageTarget? Even live without restarting the camera view?

If you have a AR.ImageDrawable (var overlay = new AR.ImageDrawable(img, 1,{}); ) you can change the image resource by calling overlay.imageResource = newImg; Put this code into a function and call it with a timer or anything else.
Hope I've been able to help you.

Related

Resize StageWebView on iPhone

I have an iPhone app which uses facebook. The user experience is not great if you just create a stagewebview object because of the lag in anything showing up when the page is being downloaded. The way I tried to get around it is like this:
ShowLoadingAnimation();
webView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0,0,0,0);
webView.addEventListener(Event.COMPLETE,PageLoaded);
public function PageLoaded(e:Event):void
{
webView.viewPort = new Rectangle( 0, 105, 600,295);
RemoveLoadingAnimation();
}
So create an empty stageview which is obscured by a beautiful :-) loading animation and when the page has been loaded - we resize the webview to it's proper size. Works perfect in a desktop AIR player. But on an iPhone it doesn't work at all and you end up with a very large black box.
Anyone has any idea on how to fix this OR a better way of doing this?
By default stageWebView objects are always at the top of the display list stack.
This means that your loading animation is underneath.
The correct way to do this is to show your loading animation and then wait to set the stage property of the stageWebView object until the page is loaded.
Hope this helps.

create fliping book with images

I want to create a application in which i required following function
create array of images in view and move like page turning effect orientation change then same view will execute. tap on image then zoom in or zoom out image.
double tap then upload bigger image from web-services.
on image when select part of image then open url of that image.
Try these Sample code
https://github.com/devindoty/iBooks-Flip-Animation
http://oleb.net/blog/2010/06/app-store-safe-page-curl-animations/
https://github.com/mtabini/AFKPageFlipper
AFKPageFlipper will help you with the page-flip-effect. The other questions: First, try to solve it self (zoom, ...) and if you have problem ask a new questions here.

how to animate launch image once app has finished launching

I was wondering how I can manipulate the launch image of an iPhone app? I have put launchImage.png into my plist file (under Launch image (iPhone)) and when the app starts I would like to animate this launch image out of the view, like so:
launchImage.transform = CGAffineTransformMakeTranslation(-CGRectGetWidth(launchImage.frame), 0);
But how do I access an image which I've defined in my plist?
Or will I simply load another instance of the image and then animate it out of the way? This appears a little cumbersome, especially as the app has already loaded the launch image.
Any suggestions would be very much appreciated! Thanks in advance!
You'll have to load another instance. You can't access the launch image from your app. I usually just make a UIImage that matches the launch image and in my viewDidAppear method I animate it away with a performSelector:withDelay: of a second or 2.
Your best bet is to create a UIImageView instance set to display your launch image, put it on the root view controller's view, then animate it out of the way as you've described (perhaps in -viewDidAppear:). As far as I know, there's no API mechanism for interacting with the launch image directly.
You have to load up the launch image again and then animate it out.

question regarding <img> and thumbnails

I have a photo site which renders previews of my photos in a tag when i hover some dots. (see http://johanberntsson.se/photo/).
But it feels kinda stupid to load the full image in to an img-tag. Because as far as i know, theres no difference between loading the image with its original size versus adding height and width attributes to it.
Got any suggestions how to improove my preview function?
Thanks
As far as client side is concerned, there's nothing you can do. If you're worried about how long it takes the image to load, you could always pre-load them with javascript. The only other thing would be to create a few sizes of your image on the server.
You should resize the image to get better speed. Here's an example in php
//Blob if image in database
$blob = mysql_fetch_...();
//else blob point to filename
$blob = "filename.jpg";
$gd = imagecreatefromstring($blob);
$resized = imagecreatetruecolor(X, Y); // new image dimensions
imagecopyresampled(....);
imagejpeg($resized);
Loading all the thumbnails in a giant sprite image used as a background image. Then position the background a the right place to have the right image a the right place.
This will improve the loading speed by loading only 1 image and allow the browser to cache the request of the image so, next time the user come to your site, it will load pretty fast.

How to modify in real time the video stream from the iPhone camera?

Every time the camera of the iPhone captures a new image, I want to modify it and then display it on the iPhone screen. In other way: how to modify in real time the video stream from the iPhone camera?
I need a method who is called every time when a new image comes from the camera.
Thanks for your help! :-)
EDIT: what I want to do is like augmented reality: while I'm taking a video, every image is modified, and is showed in real time on the iPhone screen.
You could capture an image with the UIImagePickerController's takePicture method and draw your modified version to the cameraOverlayView.
You get the picture recorded as a result of the takePicture message from the UIImagePicker's delegate in a imagePickerController:didFinishPickingMediaWithInfo:. From the dictionary supplied to that method, you can get the original image which you modify and draw to the overlay.
Here is an example for using the cameraOverlayView. You should be able to re-use the captured image from your delegate for drawing your overlay view.
Many augmented reality apps do not actually modify the image but just overlay information based on what they think is on the screen from input from the accelerometer and compass. If this is the kind of AR you are looking to do then try looking at ARKit.
You cannot process the camera's image data in real time. THere is no API to do this. File a request with Apple using their bug tracker. Many of us have done this already. More requests might lead to this being possible.
Oh, yes, just use an overlay view then. You were talking about modifying the video stream, which is clearly not needed.