private void btAreaShape_Click(object sender, EventArgs e) { FrmPatchLineAndArea frm = new FrmPatchLineAndArea(esriSymbologyStyleClass.esriStyleClassAreaPatches); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { pAreaPatch = frm.GetAreaPatch(); if (pAreaPatch != null) { this.btAreaShape.Image = frm.GetImageByGiveSymbolAfterSelectItem(btAreaShape.Width, btAreaShape.Height); } } }
private void btAreaShape_Click(object sender, EventArgs e) { FrmPatchLineAndArea Frm = new FrmPatchLineAndArea(esriSymbologyStyleClass.esriStyleClassAreaPatches); Frm.ShowDialog(); if (Frm.DialogResult == DialogResult.OK) { pAreaPatch = Frm.GetAreaPatch(); if (pAreaPatch != null) { //pLegendFormat.DefaultAreaPatch = pAreaPatch; btAreaShape.Image = Frm.GetImageByGiveSymbolAfterSelectItem(btAreaShape.Width - 14, btAreaShape.Height - 14); } } }
private void method_0() { this.txtTitle.Text = this.ilegend_0.Title; ILegendFormat format = this.ilegend_0.Format; this.chkShow.Checked = format.ShowTitle; this.txtTitle.Enabled = format.ShowTitle; this.cboTitlePosition.SelectedIndex = ((int)format.TitlePosition) - 1; this.txtWidth.Text = format.DefaultPatchWidth.ToString("#.##"); this.txtHeight.Text = format.DefaultPatchHeight.ToString("#.##"); this.listView1.Items[0].SubItems[1].Text = format.HeadingGap.ToString("#.##"); this.listView1.Items[1].SubItems[1].Text = format.VerticalItemGap.ToString("#.##"); this.listView1.Items[2].SubItems[1].Text = format.HorizontalItemGap.ToString("#.##"); this.listView1.Items[3].SubItems[1].Text = format.LayerNameGap.ToString("#.##"); this.listView1.Items[4].SubItems[1].Text = format.GroupGap.ToString("#.##"); this.listView1.Items[5].SubItems[1].Text = format.TitleGap.ToString("#.##"); this.listView1.Items[6].SubItems[1].Text = format.TextGap.ToString("#.##"); this.listView1.Items[7].SubItems[1].Text = format.VerticalPatchGap.ToString("#.##"); this.listView1.Items[8].SubItems[1].Text = format.HorizontalPatchGap.ToString("#.##"); IStyleGalleryItem oO = new MyStyleGalleryItem { Name = "<定制>" }; this.ilinePatch_0 = format.DefaultLinePatch; oO.Item = this.ilinePatch_0; this.cboLinePatches.SelectStyleGalleryItem(oO); oO = new MyStyleGalleryItem { Name = "<定制>" }; this.iareaPatch_0 = format.DefaultAreaPatch; oO.Item = this.iareaPatch_0; this.cboAreaPatches.SelectStyleGalleryItem(oO); this.chkRightToLeft.Checked = (this.ilegend_0 as IReadingDirection).RightToLeft; }
//选择样式前返回面图片 public Image GetImageByGiveAreaSymbolBeforeSelectItem(esriSymbologyStyleClass styleClass, IAreaPatch symbol, int width, int height) { axSymbologyCtlFrame.StyleClass = styleClass; ISymbologyStyleClass symbologyStyleClass = axSymbologyCtlFrame.GetStyleClass(styleClass); IStyleGalleryItem styleGalleryItem = new ServerStyleGalleryItem(); styleGalleryItem.Item = symbol; symbologyStyleClass.AddItem(styleGalleryItem, 0); symbologyStyleClass.SelectItem(0); stdole.IPictureDisp picture = symbologyStyleClass.PreviewItem(pStyleGalleryItem, width, height); System.Drawing.Image image = System.Drawing.Image.FromHbitmap(new System.IntPtr(picture.Handle)); return(image); }
//调用该窗口后返回面样式 public IAreaPatch GetAreaPatch() { IAreaPatch pAreaPatch = pStyleGalleryItem.Item as IAreaPatch; return(pAreaPatch); }
public AreaPatchDraw(IAreaPatch iareaPatch_0) : base(iareaPatch_0) { }