event.object.lastVisionImage.getBitmap is not a function - nativescript

I am doing a small project on Nativescript, using the ML kit for face recognition
My task is to take a photograph after a face has been recognized. On Android, this function works fine and the image is saved, but on iOS, an error occurs.
Tell me, what could be the problem and how to solve it?
const bmp = event.object.lastVisionImage.getBitmap();
const source = new ImageSource();
source.setNativeSource(bmp);
var imageData = source.toBase64String("jpeg");
'NativeScript encountered a fatal error: TypeError:
event.object.lastVisionImage.getBitmap is not a function. (In
'event.object.lastVisionImage.getBitmap()',
'event.object.lastVisionImage.getBitmap' is undefined)

Does this come from this unofficial plug-in?
https://market.nativescript.org/plugins/nativescript-plugin-firebase-mlkit-unofficial
I'm afraid MLKit team doesn't officially support the NativeScript plugin, posting the question in the community of the plugin provider might get an answer more efficiently. Thanks!

Related

Syncfusion Webkit rendering engine binaries notarization on MAC

I am using html to PDF conversion using syncfusion webkit rendering on MAC os. It works fine until I notarize my app. When I tried to notarize my app, I got errors like QtMacBinaries are not signed.
I signed all QtMacBinaries using my developer id certificates. Now notarization got success but html to PDF conversion is failing.
I am getting below error:
Syncfusion.Pdf.PdfException: dyld: Library not loaded: #rpath/libQt5Core.5.dylib
Referenced from: /Users/sangapankaj/Projects/TestConverter/bin/Release/TestConverter.app/Contents/Resources/QtBinariesMac/Syncfusion.WebKitWrapper
Reason: image not found
,'Html conversion failed
Syncfusion version: Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core.18.2.0.44,
OS: MAC 10.14,
Compiler: Visual Studio 2019,
Language: dot net
I am not sure what I am missing? Main culprit is Syncfusion.WebkitWrapper binary. It is not able to load QT libraries if I have signed it with my developer id certificates. If I use it without signing, it works fine.
Code
HtmlToPdfConverter htmlToPdfConverter;
WebKitConverterSettings webKitConverterSettings;
PdfDocument pdfDocument = null;
try
{
htmlToPdfConverter = new HtmlToPdfConverter();
webKitConverterSettings = new WebKitConverterSettings();
webKitConverterSettings.WebKitPath = "/Applications/MacUncle OLM Converter.app/Contents/Resources /QtBinariesMac";
htmlToPdfConverter.ConverterSettings = webKitConverterSettings;
string strTempPath = Path.GetTempPath();
pdfDocument = htmlToPdfConverter.Convert(bdy, strTempPath);
}
catch(Exception e)
{
string exp = string.Format("{0} exception caught", e);
Log.WriteErrorLog(exp);
}
We have checked the reported issue in our end, but we did not face this error in Mac with our WebKit converter. We internally make use of the QtWebKit rendering engine for converting HTML to PDF We have to provide the WebKitPath as folder location of QtBinariesMac path in your machine.
We have analyzed about the reported issue, we suspect the issue occurs due to the signed binaries not loaded properly in your application. After the notarization, If the binaries are compressed in any format (.pkg), please extract it and try the conversion. However, please make sure that you are running the latest XCode version where the conversion take place. Please try the below suggestions in your end and let us know the result.
https://developer.apple.com/forums/thread/124810
https://developer.apple.com/forums/thread/128435
https://github.com/Alamofire/Alamofire/issues/3051#issuecomment-580003683
Note : I work for Syncfusion.

Unable To Share Text On Xamarin Form

Hello Everyone I want to share the Text on Xamarin Form using Library plugin.share. I have successfully implemented the library and on android i can able to share the text but in iOS it returns me nothing. i have done the share code on button click event so when i click on button in iOS its doesn't returns me anything.i tried the Below code but doesn't got succeed
CrossShare.Current.Share("Hii alll", "Share");
please help me to get out of this,thanks in advance
You want to take a look at UIActivityViewController, you can find the documentation here https://developer.xamarin.com/api/type/MonoTouch.UIKit.UIActivityViewController/
And Xamarin.Forms specific example http://devcenter.wintellect.com/jwood/implementing-sharing-in-xamarin-forms
This is a bit old, but I was having a similar issue and was able to resolve it.
First of all, you need to add the plugin Plugin.Share to ALL Xamarin.Forms projects (Portable, iOS, Android, UWP).
In the class that references the share code, add...
using Plugin.Share;
using Plugin.Share.Abstractions;
CrossShare.Share() doesn't work with strings, directly. You need to new up a ShareMessage.
var title = "Title For The Share";
var message = "Text to share.";
await CrossShare.Current.Share(new ShareMessage { Text = message, Title = title });
I can't say specifically to iOS, as I don't have a Mac and can't test that project, but Android and Windows 10 is working.

How to resize image file on Xamarin.forms. (+ writeableBitmap package can't be added)

I'm making iOS and Android app using with Xamarin.forms. (PCL project)
I need to resize my image file from 'MediaFile class' that is returned from 'CrossMedia.Current.PickPhotoAsync ()'.
What's your best way to do it?
and I have searched long time and noticed that many people uses 'writeableBitmap'.
But this 'writeableBitmap' nuget package can not be added because Xamarin platform is updated?
I got great answer from here.
https://forums.xamarin.com/discussion/comment/199212#Comment_199212
It's using DependencyService and it works beautifully.
After applied DependencyService, I got a question.
In my thinking, image file is not dependent so why don't we process it just in 'forms' using with SOME image process library in .net? (I'm not a .net developer but I believe that there is many library to process image file)
I suspect that we should have done because we want to use built-in image processing library(like UIKit) so that we could avoid adding new one?
Am I correct?

How to solve Run-Time Error '429 : Activex component can't create object' in VB6?

I ve seen a lot of questions about this but still couldnt find a solution for my code.
I had this problem in VB6 while debugging..
Set img = New ImageFile
img.LoadFile mainform.picturePath & stock & ".jpg"
seems like i cannot create a new ImageFile and getting this crazy error report.
I tried more than several dll registering.
I also tried updating DirectX to 9.0c and re installed vb6 - office components..
But still getting the error. I dont know what could be causing that.
I'm not sure your reference is correct here. ADO does not have an ImageFile type.
I think what you want is the Windows Image Acquisition Automation Library
After installing you can update your references in the VB project and should be able to correctly create an instance of an ImageType.

obtainStyledAttributes in monodroid

I'm trying to replicate monodroid example for gallery tutorial.
But the example is missing one important point : how to set the background style of ImageView.
On Android tutorial we have the following code :
TypedArray attr = mContext.obtainStyledAttributes(R.styleable.HelloGallery);
mGalleryItemBackground = attr.getResourceId(R.styleable.HelloGallery_android_galleryItemBackground, 0);
attr.recycle();
....
imageView.setBackgroundResource(mGalleryItemBackground);
I have no idea how should I replicate it in monodroid !
Thanks in advance,
Alex
You can use the ImageView.SetImageResource(int) method to load an image from a resource Id.
Xamarin also has a Gallery sample up on their site that might be more useful to you than the Java version.

Resources