代理申請などない場合は、簡単に記入できます。
必要なのは以下です
- 身分証明書のコピー
- 振込先口座の通帳などのコピー
- 印鑑
書類はこんな感じの封筒で郵送で届きます。
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction
Command="{Binding LoadedCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
private void Loaded(Window window)
{
・・・
window.close()
}
<i:Interaction.Triggers>
<l:InteractionMessageTrigger MessageKey="Close" Messenger="{Binding Messenger, Mode=OneWay}">
<l:WindowInteractionMessageAction InvokeActionOnlyWhenWindowIsActive="False"/>
</l:InteractionMessageTrigger>
</i:Interaction.Triggers>
private void Loaded(Window window)
{
・・・
Messenger.Raise(new WindowActionMessage(WindowAction.Close, "Close"));
}
public void RunFfmpeg()
{
var proc = new Process();
proc.StartInfo.FileName = "FFmpeg.exeのパス";
proc.StartInfo.Arguments = "FFmpegのオプション指定";
proc.StartInfo.CreateNoWindow = true; // ウィンドウ表示しない
proc.StartInfo.UseShellExecute = false;
proc.Start();
}
public void RunFfmpeg()
{
var proc = new Process();
proc.StartInfo.FileName = "FFmpeg.exeのパス";
proc.StartInfo.Arguments = "FFmpegのオプション指定";
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.CreateNoWindow = true; // ウィンドウ表示しない
proc.StartInfo.UseShellExecute = false;
proc.Start();
}
public void StopFfmpeg()
{
StreamWriter inputWriter = proc.StandardInput;
inputWriter.WriteLine("q");
rtmpProc.WaitForExit(3000);
}
public void RunFfmpeg()
{
var proc = new Process();
proc.StartInfo.FileName = "FFmpeg.exeのパス";
proc.StartInfo.Arguments = "-i - -f image2pipe output.mp4";
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.CreateNoWindow = true; // ウィンドウ表示しない
proc.StartInfo.UseShellExecute = false;
proc.Start();
}
C#によるUSBカメラ操作(WPF編)
public event NewFrameEventHandler NewFrameGot = delegate { };
public void StartCamera()
{
var device = new VideoCaptureDevice("カメラ名");
device.NewFrame += NewFrameGot;
device.Start();
}
// コンストラクタで指定
NewFrameGot += CamDeviceCtrlNewFrameGot;
private void CamDeviceCtrlNewFrameGot(object sender, NewFrameEventArgs eventArgs)
{
eventArgs.Frame.Save(proc.StandardInput.BaseStream, ImageFormat.Bmp);
}
WPFのWebBrowserでHTML5を表示する
VlcLibDirectory = new DirectoryInfo(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));
string StreamParams = ":network-caching=2000";
var player = new VlcControl();
container.Content = player;
player.SourceProvider.CreatePlayer(VlcLibDirectory);
player.SourceProvider.MediaPlayer.Play(new Uri(RTMPのアドレス), StreamParams);
public partial class VLCPlayer : UserControl
{
// Extra parameters to pass to the viewer media. I found a 2 seconds buffer cache makes playing much more stable.
private const string StreamParams = ":network-caching=2000";
public VlcControl vlcPlayer;
VlcLibDirectory = new DirectoryInfo(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));
#region StreamPath
public static readonly DependencyProperty StreamPathProperty =
DependencyProperty.Register("StreamPath",
typeof(string),
typeof(VLCPlayer),
new FrameworkPropertyMetadata(string.Empty, new PropertyChangedCallback(OnStreamPathChanged)));
public string StreamPath
{
get { return (string)GetValue(StreamPathProperty); }
set { SetValue(StreamPathProperty, value); }
}
private static void OnStreamPathChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
VLCPlayer ctrl = obj as VLCPlayer;
if (ctrl == null) return;
ctrl.SetCamera();
}
#endregion
public VLCPlayer()
{
InitializeComponent();
}
public void SetCamera()
{
if (vlcPlayer != null)
{
vlcPlayer.Dispose();
vlcPlayer = null;
}
if (string.IsNullOrEmpty(this.StreamPath)) return;
vlcPlayer = AddPlayer(this.StreamPath, PlayerContainer);
}
private VlcControl AddPlayer(string streamPath, ContentControl container)
{
var player = new VlcControl();
container.Content = player;
player.SourceProvider.CreatePlayer(VlcLibDirectory);
player.SourceProvider.MediaPlayer.Play(new Uri(streamPath), StreamParams);
return player;
}
private void UserControl_Unloaded(object sender, RoutedEventArgs e)
{
try
{
if (vlcPlayer != null)
{
vlcPlayer.Dispose();
vlcPlayer = null;
}
}
catch (Exception ex) { }
}
}