/// <summary> /// イメージRECTの選択が変わった /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void objCBoxImageFile_SelectedIndexChanged(object sender, EventArgs e) { // リストビューのリストを作る m_rIF = m_com.D2Stage.FindRectFromFilePaht(objCBoxImageFile.Text); if (m_rIF == null) { return; } else if (m_rIF.GetID() != FImageRect.ID) { return; } int i; FImageRectInfo ffIRc = null; for (i = 0; i < m_rIF.aSprite.Count; ++i) { ffIRc = m_rIF.aSprite[i]; string[] item1 = { i + "", ffIRc.x + "", ffIRc.y + "", ffIRc.width + "", ffIRc.height + "" }; ListViewItem lvTmp = new ListViewItem(item1); mObjLVImageRectInfo.Items.Add(lvTmp); } //mObjXNAScreen.SetBackGroudColorChange(false); m_imageFileNo = m_com.D2Stage.RectImageNoFromFilePath(objCBoxImageFile.Text); }
public void SetImageName(string strFileName) { m_rIF = CommonMC2D.Instance.D2Stage.FindRectFromFilePaht(strFileName); //objXNAScreen.SetImage(strFileName); // イメージ情報 objLBImageName.Text = "" + strFileName; objLBWidth.Text = "" + m_rIF.width; objLBHeight.Text = "" + m_rIF.height; objLBRectNum.Text = "" + m_rIF.aSprite.Count; objUDRectX.Minimum = objUDRectWidth.Minimum = objUDRectY.Minimum = objUDRectHeight.Minimum = 0; objUDRectX.Maximum = objUDRectWidth.Maximum = m_rIF.width; objUDRectY.Maximum = objUDRectHeight.Maximum = m_rIF.height; //----------------------- // リストビューに追加 FImageRectInfo ffIRc = null; for (int i = 0; i < m_rIF.aSprite.Count; ++i) { ffIRc = m_rIF.aSprite[i]; string[] item1 = { i + "", ffIRc.x + "", ffIRc.y + "", ffIRc.width + "", ffIRc.height + "" }; ListViewItem lvTmp = new ListViewItem(item1); objLVRECT.Items.Add(lvTmp); } if (m_rIF.aSprite.Count != 0) { objLVRECT.Focus(); objLVRECT.Items[0].Selected = true; // RECR num objLBRectNum.Text = "" + m_rIF.aSprite.Count; } }
//############################################################################## //############################################################################## //## //## 読み込み //## //############################################################################## //############################################################################## #region 読み込み /// <summary> /// Rectイメージを読み込む /// </summary> /// <param name="lData"></param> /// <returns></returns> internal bool RectRead(LoadData lData) { FImageRectInfo fImgRc = null; Chunk chank = new Chunk(); ImageRect inImgFile; LoadChank lChank, lChank02; LoadData lData02; int nImgNo = 0; lData.GetChank(chank); inImgFile = new ImageRect(); while ((lChank = lData.FindData(inImgFile)) != null || !lData.GetFindEnd()) { // ツリービューに反映 //tNode = m_rTV.Nodes[0].Nodes[1].Nodes.Add(inImgFile.GetString()); //tNode.ImageIndex = 2; //tNode.SelectedImageIndex = 3; //tNode.Name = TV_NAME_RECT_IMG; //------------------------------------- // イメージRECT情報読み込み //------------------------------------- if (lChank != null) { while ((lData02 = lChank.FindChank(chank)) != null) { // 通常1回のループのみ //------------------------------- // データが正しいかチェックする fImgRc = new FImageRectInfo(); while ((lChank02 = lData02.FindData(fImgRc)) != null || !lData02.GetFindEnd()) { // データ内部部分書き込み inImgFile.aSprite.Add(fImgRc); // これ以上入れ子は今のところない予定なので入れ子は無視 if (lChank02 != null) { lChank02 = null; } fImgRc = new FImageRectInfo(); } lData02 = null; } } ReadedRectImageEventCall(this, new ReadedRectImageEvent(inImgFile)); lChank = null; inImgFile = new ImageRect(); ++nImgNo; } inImgFile = null; return(true); }
/// <summary> /// 1つRECTを作るメニューボタンを押した /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void objMOneNewRECT_Click(object sender, EventArgs e) { FImageRectInfo ffIRc = new FImageRectInfo(); m_rIF.aSprite.Add(ffIRc); string[] item1 = { m_rIF.aSprite.Count + "", ffIRc.x + "", ffIRc.y + "", ffIRc.width + "", ffIRc.height + "" }; ListViewItem lvTmp = new ListViewItem(item1); objLVRECT.Items.Add(lvTmp); objLVRECT.Focus(); objLVRECT.Items[objLVRECT.Items.Count - 1].Selected = true; // RECR num objLBRectNum.Text = "" + m_rIF.aSprite.Count; this.ResetRectState(); }
/// <summary> /// リストビューの選択が変わった /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void objLVRECT_SelectedIndexChanged(object sender, EventArgs e) { if (objLVRECT.Items.Count == 0) { return; } if (objLVRECT.SelectedItems.Count == 0) { return; } m_bSelectingRect = true; objGBRectInfo.Enabled = true; m_selectRectIndex = int.Parse(objLVRECT.SelectedItems[0].SubItems[0].Text); m_rFFIRect = m_rIF.aSprite[m_selectRectIndex]; this.ResetRectState(); }