Debian Codegraph @

Xpjproject/pjsip-apps/src/swig/csharp/sample/SimplePjsua2CS/Form1.cs

raw symbols SCIP
1 using System.Drawing;
2 using System.Windows.Forms;
3
4 namespace SimplePjsua2CS
5 {
6 public partial class Form1 : Form
7 {
8 private pjsua2xamarin.PjSample pj = new pjsua2xamarin.PjSample();
9 private Panel panel;
10 private Panel panel2;
11
12 public Form1()
13 {
14 InitializeComponent();
15 pj.start();
16 }
17
18 private void Form1_Load(object sender, System.EventArgs e)
19 {
20 panel = new Panel();
21 panel.Size = new Size(350, 250);
22 panel.Location = new Point(20, 20);
23 Controls.Add(panel);
24
25 // Tell SDL to use our window (panel)
26 pj.startPreview(panel.Handle);
27
28 // Let SDL creating its own window
29 //pj.startPreview(System.IntPtr.Zero);
30 }
31
32 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
33 {
34 pj.stopPreview();
35 pj.stop();
36 }
37
38 private void button1_Click(object sender, System.EventArgs e)
39 {
40 if (panel2 != null)
41 return;
42
43 panel2 = new Panel();
44 panel2.Size = new Size(350, 250);
45 panel2.Location = new Point(20, 250+20+10);
46 Controls.Add(panel2);
47
48 // Simulate incoming video window, i.e: initially SDL creates
49 // its own rendering window (which by default is hidden),
50 // then app may want to change the window.
51 pj.updatePreviewWindow(panel2.Handle);
52 }
53 }
54 }