mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-24 03:00:11 -04:00
Added focus button for camera
This commit is contained in:
Binary file not shown.
@@ -36,6 +36,13 @@
|
||||
</VideoBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Button Height="100" Width="100" x:Name="_focusButton"
|
||||
Click="_focusButton_Click" Margin="368,656,12,44"
|
||||
FontSize="18" Background="Black" Foreground="White">
|
||||
<TextBlock Text="Focus"/>
|
||||
</Button>
|
||||
<Border Height="400" Width="240" BorderBrush="Green" BorderThickness="3">
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ namespace BarcodeScanner
|
||||
return false;
|
||||
}
|
||||
_timer.Stop();
|
||||
_timer = null;
|
||||
_luminance = null;
|
||||
_reader = null;
|
||||
_photoCamera.Dispose();
|
||||
@@ -127,5 +128,20 @@ namespace BarcodeScanner
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void _focusButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_photoCamera != null && _photoCamera.IsFocusSupported)
|
||||
{
|
||||
try
|
||||
{
|
||||
_photoCamera.CancelFocus();
|
||||
_photoCamera.Focus();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user