Пример #1
0
        /// <summary>
        /// 写真閲覧・編集パネルを初期化する
        /// </summary>
        /// <param name="form">親フォーム</param>
        public ReviewPanel(PhotoChatForm form)
        {
            this.form = form;
            this.SuspendLayout();

            // GUI設定
            this.BackColor  = Color.LightGreen;
            this.Dock       = DockStyle.Fill;
            this.Name       = "ReviewPanel";
            this.Font       = PhotoChat.BoldFont;
            this.AutoScroll = true;
            this.AllowDrop  = true;
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.LostFocus += new EventHandler(ReviewPanel_LostFocus);

            InitializeImageBox();
            InitializeTagArea();
            InitializeSoundArea();
            InitializeTextBox();
            this.ResumeLayout(false);

            // 閲覧履歴の初期化
            historyList  = new String[PhotoChat.HistorySize];
            historyIndex = -1;
            historyFrom  = -1;
            historyEnd   = -1;
        }
Пример #2
0
 /// <summary>
 /// 写真一覧ウィンドウを作成する。
 /// </summary>
 public PhotoListWindow(PhotoChatForm form)
 {
     this.form = form;
     InitializeComponent();
     showBounds = this.Bounds;
     hideBounds = new Rectangle(form.Right - 40, form.Bottom - 35, 10, 20);
 }
Пример #3
0
        /// <summary>
        /// 設定ダイアログを作成する。
        /// </summary>
        /// <param name="form">親フォーム</param>
        public ConfigDialog(PhotoChatForm form)
        {
            this.form = form;
            InitializeComponent();

            // 現在の設定を反映
            autoScrollCheckBox.Checked = form.IsAutoScrollMode;
            logCheckBox.Checked        = form.LogWindow.Visible;
            //gpsCheckBox.Checked = form.GpsReceiver.IsActive;
        }
Пример #4
0
        /// <summary>
        /// 写真上の書き込みを文字認識して結果をタグにする。
        /// </summary>
        /// <param name="form">PhotoChatForm</param>
        public void Recognize(PhotoChatForm form)
        {
            //// ストロークの書き込みグループのみ処理
            //foreach (NoteGroup group in groupList)
            //{
            //    if (group.First.Type == PhotoChatNote.TypeStroke)
            //    {
            //        // グループ内の各ストロークを入力
            //        InkRecognizer.Clear();
            //        foreach (PhotoChatNote note in group.NoteList)
            //        {
            //            InkRecognizer.AddStroke();
            //            foreach (Point point in ((Stroke)note).Points)
            //            {
            //                InkRecognizer.AddPoint(point.X, point.Y);
            //            }
            //        }

            //        // 認識
            //        string result = InkRecognizer.Recognize().Trim();
            //        if (!PhotoChat.ContainsInvalidChars(result))
            //        {
            //            // 形態素解析くらいすべき?
            //            // とりあえずファイルに使えない文字除去&10文字制限
            //            // もっとマシなコードにするべき
            //            int index;
            //            while ((index = result.IndexOfAny(Path.GetInvalidFileNameChars())) >= 0)
            //            {
            //                result.Remove(index, 1);
            //            }
            //            while ((index = result.IndexOf('?')) >= 0)
            //            {
            //                result.Remove(index, 1);
            //            }
            //            while ((index = result.IndexOf('*')) >= 0)
            //            {
            //                result.Remove(index, 1);
            //            }
            //            if (result.Length > 10)
            //                result = result.Substring(0, 10);
            //            form.NewData(new Tag(form.Client.UserName,
            //                form.Client.GetNewSerialNumber(), photoName, result));
            //        }
            //    }
            //}
        }
Пример #5
0
        /// <summary>
        /// パレットツールウィンドウを作成する。
        /// </summary>
        public PaletteWindow(PhotoChatForm form)
        {
            this.form = form;
            InitializeComponent();

            // 初期色をランダムに設定
            if (form.ReviewPanel != null)
            {
                Random random = new Random();
                colorIndex = random.Next(DefaultColorList.Length);
                form.ReviewPanel.NoteColor = DefaultColorList[colorIndex];
                form.PenColor = DefaultColorList[colorIndex];
            }

            // 色選択ラベルの初期化
            this.colorLabel.Image = CreateColorLabelImage();

            // 太さ選択ラベルの初期化
            this.strokeSizeLabel.Image = CreateStrokeSizeLabelImage();

            // 文字サイズボックスの初期化
            this.fontSizeComboBox.Items.AddRange(FontSizeList);
            this.fontSizeComboBox.Text = PhotoChat.DefaultTextFontSize.ToString();
        }