how to access the image captured using takePicture - xcode

With takePicture, the camera captures an image (click), however I it does not call the imagePickerController:didFinishPickingMediaWithInfo: method. So how do we access the image?

Did you register as the delegate for the picker? Does your class implement UIImagePickerControllerDelegate? If you do both of these things the code should work. There are countless examples of this in the Apple documentation.

Related

How does ImageSource return bytes to the application

I would like to implement my own subclass of ImageSource. Xamarin Forms has FileImageSource, UriImageSource and several other subclasses of ImageSource, but none of them meets my needs.
To see how to implement an ImageSource subclass, I looked at implementation of FileImageSource on github (https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Core/FileImageSource.cs)
I expected to find that the subclass would override one or more ImageSource methods to actually read the image file and provide the bytes from the file to the calling platform. But source code of FileImageSource contains no such thing! In fact, they use the File only to override ImageSource.IsEmpty. How can this be? If an image is contained in a file, you need to read the file to display this image, don't you?
What am I missing? And if I want to implement my own subclass of ImageSource, how can my sublass return image data to the platform?
Edit
Thank you to everyone who proposed solving the issue in a different way and inquiring why exactly existing ImageSource subclasses do not serve my needs.
Even if there is a different way to solve my immediate issue, from an educational perspective it is still interesting to know how Xamarin Forms displays an image file without reading the file. The source code for FileImageSource is quite short and does not appear to use the file, other than to implement IsEmpty. This will bug me until I know how this works.
[Resolve the issue using converters]
Instead of creating a new ImageSource, you could create a Converter (if you are working with bindings).
So if you have something like a byte array, and you want that to be shown as an image, you can do the conversion from byte array into a StreamImageSource
[EDIT: Knowing how it works]
If you want to know how it works internally and how it transforms the File into the actual Image, you will have to go deeper into the code, and check the platform implementations.
For example here you have the android renderers. You will find the IImageSourceHandler.cs and the FontImageSourceHandler and the FileImageSourceHandler and so on.

Changing ti.barcode view size

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

How to translate between user mouse coordinates and PDFDocument coordinates?

I'm working on an app for Macintosh. I want to have the user be able to click inside a PDF rendered onscreen and have an annotation appear where they clicked (or selected). Should/can I use PDFKit for this? I looked at the classes, but PDFSelection seems to deal with text, not coordinates. Specifically, I want to know which classes I should use to achieve this. I've read the PDFKit programming guide, but I'm still not quite clear as to the path forward.
Apple provides sample code, PDF Annotation Editor, its description is:
This sample application uses PDF Kit to examine, edit, and create PDF annotations. It has an inspector panel that shows various attributes of supported annotations. The inspector allows users to edit those values. Additionally, annotations can be created and the code demonstrates how to use PDF Kit to do this. Also, the sample code demonstrates subclassing of PDFAnnotationStamp in order to override the draw method and draw your own custom annotation content. Finally, the sample code demonstrates subclassing PDFView in order to overlay your own content over the PDF content being displayed.
This would appear to answer your questions, in particular look at mouseDown in PDFEditView.
HTH

jquery + instagram + image montage

I'm having trouble integrating to jquery plugins. http://potomak.github.com/jquery-instagram/ and http://tympanus.net/codrops/2011/08/30/automatic-image-montage/
I can get the image montage to work no problem OR the instagram photos to load but I can't make the instagram photos into the image montage. I am calling the same div class for both functions.
Did you check if they are overriding some function like window.onLoad() or setting a timer that is also used by the other?
I have one kind of instagram image loader running at www.pixomundo.com feel free to look at the code there.

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