Changing ti.barcode view size - appcelerator

I'm fiddling around with ti.barcode scanner module, but it seems it's always fullscreen.
Is there a way to make it use a part of the screen?

For iOS you can use SquareCamera: https://github.com/mikefogg/SquareCamera which allows you to have the camera inside a view and scan qr codes too.
But if you want to have it cross platform I would go with the overlay variant

Not sure if you can embed the ti.barcode to a smaller view, since you don't add it to a controller.
Have you tried to set the size of the module in the capture method?
The possible workaround is to create a view with your stuff and place it in the overlay property of the capture method

Related

How to lazy load images in a scroll view

I want to show a scroll view that has fairly large number of thumbnails. eg: https://cdn.vox-cdn.com/thumbor/sddJ5KHoGDbZfx8jcNey4iahmu0=/0x0:1395x1171/1200x800/filters:focal(587x475:809x697)/cdn.vox-cdn.com/uploads/chorus_image/image/57064313/Screen_Shot_2015-09-07_at_9.11.34_AM.0.0.png
I want to load the view as fast as possible without delaying it until all images are loaded. This essentially means I need to lazy load image content. While each image is downloaded, a placeholder image (fetched locally) should be shown. I certainly know how to do this from scratch, but wanted to know if there are standard solutions available. Can I setup Xamarin.Forms.Image class to get this behavior?
Is there any particular reason for which you want to use a ScrollView specifically ?
From what you're describing, it looks like you should actually be working with a ListView instead (which will improve performance by a LOT if you have a large list of images).
Then, like #SushiHangover said, there is FFImageLoading that can help you work with these images, or you can create you own Image class, to implement a custom solution on both android and iOS.
Glide is a faily easy to use solution for Android, and SDWebImage is also a good solution for iOS.

How can I dynamically change keyframe values from code in Unity 5?

I have gameObject with animator attached to it, it has animation curves, I need to dynamically change keyframe values from code. How do I access them?
Already asked this in the Live Session. The Answer is you can't since the anim file is the core for running the Animation Controller.
The alternate way that they gave me is to use the legacy SpriteRenderer instead.
Animation Controller doesn't support Dynamic changing of the values. Instead they provided Animator for you to make Dynamic changes of path from anim files, so consider making different anim files and path to your Animator if you don't like to work with SpriteRenderer.
If "dynamically" still means editor-time, then you could use UnityEditor.AnimationUtility, which provides methods to get and set curves and key frames and more.
One can retrieve the bindings with AnimationUtility.GetCurveBindings() or AnimationUtility.GetObjectReferenceCurveBindings(). And with AnimationUtility.GetObjectReferenceCurve() one can get the key frames, make modifications and apply it with AnimationUtility.SetObjectReferenceCurve()
At runtime - probably only with workarounds.
For example via some animated relay value within a certain custom script that then applies the wanted value to the actual property on Update() - a kind of custom constraint if you will. And within that you could apply then again custom modifications via code on runtime. But on editor time and when animating, the preview would be broken because you would not directly animate the property, but only that relay value. Maybe one could use [ExecuteInEditMode] in that custom constraint behaviour and AnimationMode.InAnimationMode() to simulate a preview. But all of this would be experimental.

Windows phone append a border to an image

I'd like to append a border (20px white) to an image, save as a new jpeg image (orginal image with a border), I don't know how do I start. Can anyone give me a direction or code example?
Thanks
You have two ways to do it:
On your UI, wrap the image with a Border element with the correct settings and use new WriteableBitmap(borderElement, null) to create a new WriteableBitmap which you can then save using the SaveJpeg extension method.
Your other option is to use the WriteableBitmapEx class library to graphically add the graphical elements you want.
I've used both. The advantages for (1) is that there's less hassle in the sense of adding a dependeny on another DLL. The advantage in (2) is that you don't need to mess with your UI to create the image.

Qt - using Widgets and QLabel to display multiple images

So currently I am able to display images via URL's using QLabel, QNetworkManager and QPixmap. And then to display the image I use something like label->show(). Essentially I follow the same steps as in the pseudocode in this link:
http://developer.qt.nokia.com/forums/viewthread/7010
Now I am still somewhat new to Qt and am having difficulty extending this. What I want to do is be able to display multiple images from different URL's into essentially the same container. So basically I want to see two images in the same container/window. These images are specified by their width, height, x position and y position in the main window/container. I know that I should use widgets but I am not sure what exactly should I use? QFrame? QHBLayout? QScrollArea? etc. Any help would be appreciated.
You can use many QLabels inside a Layout to get the effect you want. The way you want to lay it out is up to you, and there's more than one layout manager. There's things like the grid layout, the box layout, etc. Have a look here for layouts. You can look at it in this simplified way:
One window has a layout and a layout has many items in it.
http://doc.qt.nokia.com/latest/layout.html
In reality widgets can contain many other widgets. To position them properly, you use the layout.

Is it possible to change image of google.maps.GroundOverlay using javascript?

I am using Google Maps for a weather information display web.
I want to show the cloud condition for past seven days.
I am using overlays to display clouds on my web.
Now my question is can we change image of google.maps.GroundOverlay using javascript?
I believe it is not possible to change the image of a GroundOverlay. The image is set in the constructor and there is currently no setter documented to change it.
What you could try is to create two GroundOverlays with the same coordinates but pass the constructor map:null on one of them so it doesn't show on your map. Then, when you want to replace the image, call setMap(null) on the overlay that is showing--that will hide it--and then call setMap(map) (assuming you set your map to a variable named map) on the overlay that you want to show.
There's currently no way to change GroundOverlay's image via maps API. Instead, create new GroundOverlay with the same bounds for the new image. And remove the original GroundOverlay.
This has changed from 2011.
In Google Maps API V3, GroundOverlay class extends MVCObject which has getters and setters.
So you can indeed change image of ground overlay with overlay.set("url", newImage). Similarly, you can change overlays bounds with overlay.set("bounds",bounds).
After changing overlay properties, you have to reassign the map object to it with overlay.setMap(map).

Resources