Пример #1
0
        private void DrawParticipantImage(Graphics gdi, NamedRectangle shape, string imageFile, int participantNo)
        {
            int x = Convert.ToInt32(shape.Right);
            int y = Convert.ToInt32(shape.Top);

            string fileName = Server.MapPath(@"~/AgilePoint/resource/en-us/" + imageFile + ".gif");

            if (!System.IO.File.Exists(fileName))
            {
                return;
            }

            System.Drawing.Image image = Bitmap.FromFile(fileName);
            if (image != null)
            {
                x = x - image.Width / 2;
                y = y - image.Height / 2;
                gdi.DrawImage(image, x, y, image.Width, image.Height);

                // Draw number of participant in case of multiparticipant
                if (participantNo > 1)
                {
                    StringFormat sf = new StringFormat();
                    sf.Alignment = StringAlignment.Center;
                    string text = "(" + participantNo.ToString() + ")";
                    Font   f    = new Font("Arial", 10, FontStyle.Bold);
                    System.Drawing.Rectangle rect = new System.Drawing.Rectangle(x + image.Width - 5, y, 24, 16);
                    gdi.DrawString(text, f, new SolidBrush(Color.Red), rect, sf);
                }
            }
        }
 private string AddAreaControl(NamedRectangle shp)
 {
     string sCoords = string.Format("{0},{1},{2},{3}", (int)shp.Left, (int)shp.Top, (int)shp.Right, (int)shp.Bottom);
     string sOnclick = string.Format("showActivityInfo('{0}',{1},{2})", shp.Name, (int)((shp.Left + shp.Right) * 0.5), (int)((shp.Top + shp.Bottom) * 0.5));
     string sOnMouseOver = string.Format("highlightActivity({0},{1},{2},{3},'{4}')", (int)shp.Left - EDGE_WIDTH, (int)shp.Top - EDGE_WIDTH, (int)(shp.Right - shp.Left), (int)(shp.Bottom - shp.Top), shp.Name);
     return string.Format(
         "<area coords=\"{0}\" href=\"#\" onmouseover=\"{1}\">\n", sCoords, sOnMouseOver);
 }
Пример #3
0
        private string AddAreaControl(NamedRectangle shp)
        {
            string sCoords      = string.Format("{0},{1},{2},{3}", (int)shp.Left, (int)shp.Top, (int)shp.Right, (int)shp.Bottom);
            string sOnclick     = string.Format("showActivityInfo('{0}',{1},{2})", shp.Name, (int)((shp.Left + shp.Right) * 0.5), (int)((shp.Top + shp.Bottom) * 0.5));
            string sOnMouseOver = string.Format("highlightActivity({0},{1},{2},{3},'{4}')", (int)shp.Left - EDGE_WIDTH, (int)shp.Top - EDGE_WIDTH, (int)(shp.Right - shp.Left), (int)(shp.Bottom - shp.Top), shp.Name);

            return(string.Format(
                       "<area coords=\"{0}\" href=\"#\" onmouseover=\"{1}\">\n", sCoords, sOnMouseOver));
        }
 private void AddImageContrl(NamedRectangle shp, String type, bool hide)
 {
     HtmlImage image = new HtmlImage();
     image.Src = "resource/en-us/" + type + ".gif";
     image.ID = shp.Name + "_" + type;
     image.Style["Z-INDEX"] = "200";
     image.Style["LEFT"] = String.Format("{0}px", (int)shp.Left - 12);
     image.Style["TOP"] = String.Format("{0}px", (int)shp.Top - 12);
     image.Style["POSITION"] = "absolute";
     image.Style["DISPLAY"] = hide ? "none" : "";
     PlaceHolder.Controls.Add(image);
 }
Пример #5
0
        private void AddImageContrl(NamedRectangle shp, String type, bool hide)
        {
            HtmlImage image = new HtmlImage();

            image.Src = "resource/en-us/" + type + ".gif";
            image.ID  = shp.Name + "_" + type;
            image.Style["Z-INDEX"]  = "200";
            image.Style["LEFT"]     = String.Format("{0}px", (int)shp.Left - 12);
            image.Style["TOP"]      = String.Format("{0}px", (int)shp.Top - 12);
            image.Style["POSITION"] = "absolute";
            image.Style["DISPLAY"]  = hide ? "none" : "";
            PlaceHolder.Controls.Add(image);
        }
        private void DrawParticipantImage(Graphics gdi, NamedRectangle shape, string imageFile, int participantNo)
        {
            int x = Convert.ToInt32(shape.Right);
            int y = Convert.ToInt32(shape.Top);

            string fileName = Server.MapPath(@"~/AgilePoint/resource/en-us/" + imageFile + ".gif");
            if (!System.IO.File.Exists(fileName)) return;

            System.Drawing.Image image = Bitmap.FromFile(fileName);
            if (image != null)
            {
                x = x - image.Width / 2;
                y = y - image.Height / 2;
                gdi.DrawImage(image, x, y, image.Width, image.Height);

                // Draw number of participant in case of multiparticipant
                if (participantNo > 1)
                {
                    StringFormat sf = new StringFormat();
                    sf.Alignment = StringAlignment.Center;
                    string text = "(" + participantNo.ToString() + ")";
                    Font f = new Font("Arial", 10, FontStyle.Bold);
                    System.Drawing.Rectangle rect = new System.Drawing.Rectangle(x + image.Width - 5, y, 24, 16);
                    gdi.DrawString(text, f, new SolidBrush(Color.Red), rect, sf);
                }
            }
        }