This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ScanPreviewBuffer() | |
{ | |
try | |
{ | |
_photoCamera.GetPreviewBufferY(_luminance.PreviewBufferY); | |
var binarizer = new HybridBinarizer(_luminance); | |
var binBitmap = new BinaryBitmap(binarizer); | |
var result = _reader.decode(binBitmap); | |
Dispatcher.BeginInvoke(() => DisplayResult(result.Text)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e) | |
{ | |
int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); | |
int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); | |
_luminance = new PhotoCameraLuminanceSource(width, height); | |
_reader = new QRCodeReader(); | |
Dispatcher.BeginInvoke(() => { | |
_previewTransform.Rotation = _photoCamera.Orientation; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly DispatcherTimer _timer; | |
private readonly ObservableCollection<string> _matches; | |
private PhotoCameraLuminanceSource _luminance; | |
private QRCodeReader _reader; | |
private PhotoCamera _photoCamera; | |
public MainPage() | |
{ | |
InitializeComponent(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid x:Name="LayoutRoot" Background="Transparent"> | |
<Rectangle x:Name="_previewRect" | |
Margin="0" | |
Height="800" | |
Width="600" | |
HorizontalAlignment="Center" | |
VerticalAlignment="Center"> | |
<Rectangle.Fill> | |
<VideoBrush x:Name="_previewVideo"> | |
<VideoBrush.RelativeTransform> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace CryptoTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@foreach (var dokument in Model.Dokumenter) | |
{ | |
<tr> | |
<td></td> | |
<td>@dokument.Tittel</td> | |
<td>@dokument.Avsender</td> | |
<td>@dokument.Dokumentdato.TilNorskDato()</td> | |
<td>@dokument.Kvittert</td> | |
</tr> | |
foreach (var vedlegg in dokument.Vedlegg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class AnimationService | |
{ | |
public static void FadeOut(this UIView view, float duration = 1.0f, float opacity = 0.0f) | |
{ | |
Animate(duration, () => { | |
view.Layer.Opacity = opacity; | |
}); | |
} | |
public static void Animate(double duration, Action block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ShowEndScreen() | |
{ | |
UIView.BeginAnimations("ShowEndScreen"); | |
UIView.SetAnimationDuration(1.5f); | |
UIView.SetAnimationDidStopSelector(new Selector("didFinishAnimation:")); | |
UIView.SetAnimationDelegate(this); | |
_grid.Layer.Opacity = 0.0f; | |
_grid.Alpha = 0.0f; | |
_grid.Transform = CGAffineTransform.MakeRotation((float)Math.PI); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ShowEndScreen() | |
{ | |
UIView.BeginAnimations("ShowEndScreen"); | |
UIView.SetAnimationDuration(1.5f); | |
UIView.SetAnimationDidStopSelector(new Selector("didFinishAnimation:")); | |
UIView.SetAnimationDelegate(this); | |
_grid.Layer.Opacity = 0.0f; | |
_grid.Alpha = 0.0f; | |
_grid.Transform = CGAffineTransform.MakeRotation((float)Math.PI); |