- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
using System.Drawing;
using System.Drawing.Drawing2D;
namespace WindowsFormsApplication1
{
[Serializable]
public class GMapBaloonTool: GMapToolTip, ISerializable
{
public float Radius = 10f;
public GMapBaloonTool(GMapMarker marker)
: base(marker)
{
Stroke = new Pen(Color.FromArgb(140, Color.Navy));
Stroke.Width = 3;
this.Stroke.LineJoin = LineJoin.Round;
this.Stroke.StartCap = LineCap.RoundAnchor;
Fill = Brushes.Pink;
}
上面的代码,让工具提示改变了它的颜色。
我正在使用 gMaps.net在 winforms C# 中创建自定义谷歌地图。我正在努力添加一个标记 + onClick 事件,它将显示来自 DVR 的视频源。
唯一的问题是,内置的 GMapsToolTip 只显示字符串,尽管我有一个 activeX 作为相机的控件。
我需要的是在工具提示中显示相机(activeX)。
锯this在 greatmaps 的一个论坛上。创作者说我可以制作自定义工具提示。
所以我要问的是,是否可以使用此 system.drawing 命名空间创建/添加控件?
如果可能的话,请告诉我怎么做..
如果没有,如果您知道任何其他方式,请告知。
public override void OnRender(Graphics g)
{
System.Drawing.Size st = g.MeasureString(Marker.ToolTipText, Font).ToSize();
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(Marker.ToolTipPosition.X, Marker.ToolTipPosition.Y - st.Height, st.Width + TextPadding.Width, st.Height + TextPadding.Height);
rect.Offset(Offset.X, Offset.Y);
using (GraphicsPath objGP = new GraphicsPath())
{
objGP.AddLine(rect.X + 2 * Radius, rect.Y + rect.Height, rect.X + Radius, rect.Y + rect.Height + Radius);
objGP.AddLine(rect.X + Radius, rect.Y + rect.Height + Radius, rect.X + Radius, rect.Y + rect.Height);
objGP.AddArc(rect.X, rect.Y + rect.Height - (Radius * 2), Radius * 2, Radius * 2, 90, 90);
objGP.AddLine(rect.X, rect.Y + rect.Height - (Radius * 2), rect.X, rect.Y + Radius);
objGP.AddArc(rect.X, rect.Y, Radius * 2, Radius * 2, 180, 90);
objGP.AddLine(rect.X + Radius, rect.Y, rect.X + rect.Width - (Radius * 2), rect.Y);
objGP.AddArc(rect.X + rect.Width - (Radius * 2), rect.Y, Radius * 2, Radius * 2, 270, 90);
objGP.AddLine(rect.X + rect.Width, rect.Y + Radius, rect.X + rect.Width, rect.Y + rect.Height - (Radius * 2));
objGP.AddArc(rect.X + rect.Width - (Radius * 2), rect.Y + rect.Height - (Radius * 2), Radius * 2, Radius * 2, 0, 90); // Corner
objGP.CloseFigure();
g.FillPath(Fill, objGP);
g.DrawPath(Stroke, objGP);
}
g.DrawString(Marker.ToolTipText, Font, Foreground, rect, Format);
g.DrawString(ToolTipText, ToolTipFont, TooltipForeground, rect, ToolTipFormat);
}
#region ISerializable Members
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("Radius", this.Radius);
base.GetObjectData(info, context);
}
protected GMapBaloonTool(SerializationInfo info, StreamingContext context)
: base(info, context)
{
this.Radius = Extensions.GetStruct<float>(info, "Radius", 10f);
}
#endregion
}
}
此代码使气球呈圆形,所以我不知道如何添加我的控件以使其看起来像这样..(由 html 制作,但我需要它在 winforms 上)
希望有人能帮助我。哦,如果您只想将我重定向回 greatmaps 的讨论站点,请不要这样做。我从那里不太了解,所以我在这里问。
最佳答案
您可以尝试在相机控件上使用 DrawToBitmap 方法。我希望发生以下三种情况之一:
您最好的选择是数字 2 和 3,因为它们可用于提供您想要的功能。如果您得到第 1 个,则控件呈现不使用 Winforms 的常用呈现逻辑,因此您必须解决它。
在实践中,您可能希望更直接地访问相机渲染输出,因为每秒创建 25 个位图可能工作量太大而无用。你会到达那里:)
关于c# - 我可以在 system.drawing 中添加一个控件,例如一个按钮吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20232754/
Draw joust是什么游戏 Draw joust是一款voodoo推出的玩家对战类游戏,Draw joust游戏中文版叫做手绘战车游戏。 这次voodoo将该游戏的玩法再度升级,难度也有所提
我在本地托管了 draw.io,我们正在使用它来直观地表示仓库中托盘的位置。问题在于,当你在周围拖动托盘时,你经常会不小心调整它们的大小,这很痛苦。无论如何我可以禁用它或锁定托盘的大小吗? 最佳答案
我想在 draw.io 中格式化一个矩形,这样只有一个边框(左边框)是黑色的,其他边框:顶部、右侧和底部必须保持“清晰”。 我试图找出正确的编码来仅影响这些元素,但似乎您只能使用样式键影响整个边框:i
我的线正在连接,即使我没有将它们设置为多边形。 我的脚本基于 pyshp 包。 我的脚本如下所示: w=Shapefile.Writer() #shapetype 11 is a polylineZ
我在表单值中有一个标题(“cadeau check 50 €”),我想使用 arial.ttf 将其写入背景图像。我的文字是正确的,但对于欧元符号。我有 2 [] 到位。我不知道问题出在哪里。这是 P
我收到上述错误。我需要帮助修复它。我看过this question它似乎对我没有任何帮助,我在与需要它的指令相同的元素上拥有所需的指令。我也不明白为什么我的错误说无法找到指令“绘图”所需的 Contr
我正在使用 VBUC 将 VB6 应用程序迁移到 C#但我得到了这个错误: 无法将类型“System.Drawing.Image”转换为“System.Drawing.Icon”我的代码是:
我有一行代码是从某个地方借来的,Visual Studio 无法解决 Bitmap或 ImageConverter类引用。 我有: using System.Drawing; 代码行是 Image x
我正在尝试将花费很长时间的大型 Lucidchart 图转换为 Draw.io。 Draw.io 推荐 ctr-a、ctr-c、ctr-v,但这似乎不起作用。然而,Draw.io 也隐晦地提到: dr
我想显示一个相对较长的图表。我曾经使用过 javafx Canvas ,但有时会出现缓冲区溢出异常,因为绘制了很多值。我正在寻找一种不同的方法,并找到了一种使用 java.awt.graphics2d
我很困惑 System.Drawing.Image 和 System.Drawing.Bitmap 之间有什么不同 有人可以解释这两种类型之间的主要区别吗? 为什么要使用 System.Drawing
声明了一个位图 private Bitmap img1 = null; private Bitmap img2 = null; 从openFileDialog中选择图像后,图像将被放置。 选定的图
我想遍历 System.Drawing.Color 结构并使用它来初始化笔列表。 我是这样试的,但是字段类型不合适: colorList = new List(); foreach (
System.Drawing.Point 和 System.Drawing.PointF 有什么区别。你能举个这两者之间的例子吗? 提前致谢。 最佳答案 Point 使用整数坐标(int 代表 X 和
我正在为我们公司开发 WinForm 打印应用程序。 打印文档时,我需要获取文档上每个控件的System.Drawing.Color属性,并创建一个System.Drawing.Brush对象来画出来
我正在使用这个从另一个应用程序获取图标: Icon IEIcon = Icon.ExtractAssociatedIcon(@"C:\Program Files\Internet Explorer\
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
在 UIView 子类中,我覆盖了 Draw 子类以绘制一些自定义文本,但文本始终绘制为翻转文本。 这是我正在使用的代码: class TextViewProblem : UIView { publi
我想从 Zotero 导出的嵌套 XML/JSON(嵌套在子集合和集合中的单个项目)以编程方式生成 draw.io map 图。 我已经有了基本的 JSON/XML,可以适应 draw.io 的格式,
1) 重新绘制与绘制 这是一个哲学问题,但是...在不同分辨率下渲染游戏的“正确”或“可接受”的方式是什么(2d,我理解 OGL 视角如何工作...)?我应该为我的图像(如 Android APK)添
我是一名优秀的程序员,十分优秀!