Da ich das Bild in der Datenbank der SQLite von Kamera-Schaltfläche eingeben kann, fügen Sie es in Hinzufügen ein.Wie eingeführtes Bild in SQLite XAML UWP
private async void AddButton_Click (object sender, RoutedEventArgs e)
{
var selectedDate = Data1.Date.UtcDateTime;
DataBaseHelper Db_Pet = new DataBaseHelper();
if (txtnombre.Text != "" & txtchip.Text !="" & txtraza.Text !="" & SelectedgeneroText !="" & txtcolor.Text != "" )
{
Db_Pet.Insert(new Mascota(txtnombre.Text, txtchip.Text, txtraza.Text, SelectedgeneroText, txtcolor.Text,selectedDate));
}
else
{
MessageDialog md = new MessageDialog("Enter your pet");
await md.ShowAsync();
}
}
private async void btcapture_Click (object sender, RoutedEventArgs e)
{
CameraCaptureUI cameraUI = new CameraCaptureUI();
cameraUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
cameraUI.PhotoSettings.CroppedSizeInPixels = new Size(150, 150);
StorageFile photo = await cameraUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (photo == null)
{
return;
}//cierre del if
IRandomAccessStream stream = await photo.OpenAsync(FileAccessMode.Read);
BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream);
SoftwareBitmap softwareBipMap = await decoder.GetSoftwareBitmapAsync();
SoftwareBitmap softwareBitmapBGR8 = SoftwareBitmap.Convert(softwareBipMap,
BitmapPixelFormat.Bgra8,
BitmapAlphaMode.Premultiplied);
SoftwareBitmapSource bitmapSource = new SoftwareBitmapSource();
await bitmapSource.SetBitmapAsync(softwareBitmapBGR8);
Capture.Source = bitmapSource;
}
Ich bin verwirrt über das, was Sie fragen. Könnten Sie bitte Einzelheiten zu Ihrem Problem erfahren? Was "wie eingeführtes Bild" bedeutet? –
Ich möchte das Bild in der SqLite – user3682557