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;
}
the above code, makes the tooltip change its color.
I am using gMaps.net to create custom google map inside winforms C#. I am working unto adding a marker + onClick event that will display video feeds from the DVR.
Only problem is that, the built in GMapsToolTip only displays strings although I have an activeX that act as a control for the camera.
What I need is to display the camera(activeX) inside the tooltip.
Saw this on a forum in greatmaps. Creator said I can make custom tooltips.
so what I am asking is, is it possible to create/add controls using this system.drawing namespace?
if possible, please do tell me how..
if not, if you know any other way, let know it.
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
}
}
this code makes the balloon on a rounded shape, so I don't know how to add my control to look something like this.. (made from html, but I need it on winforms)
hoping for someone who can help me. and oh, if you will only redirect me back to the discussion site of greatmaps, please don't. I can't understand much from there, so I asked in here.