• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.Image类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.WebControls.Image的典型用法代码示例。如果您正苦于以下问题:C# Image类的具体用法?C# Image怎么用?C# Image使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Image类属于System.Web.UI.WebControls命名空间,在下文中一共展示了Image类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: gridGAC_RowDataBound

    protected void gridGAC_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.Cells.Count > 3)
            {
                // Last modified on is in Column - 3, index starts at 0.
                int compare = System.DateTime.Compare(DateTime.Parse(e.Row.Cells[2].Text), System.DateTime.Today);

                if (compare > 0)
                {
                    System.Web.UI.WebControls.Image tickImage = new System.Web.UI.WebControls.Image();
                    tickImage.ImageUrl = "~/Images/tick-circle-frame-icon.png";
                    tickImage.ToolTip = "This DLL was installed into GAC today.";

                    e.Row.Cells[0].Controls.Add(tickImage);
                    e.Row.Cells[1].ForeColor = Color.Teal;
                    e.Row.Cells[2].ForeColor = Color.Teal;
                    e.Row.Cells[3].ForeColor = Color.Teal;
                }
            }

            if (e.Row.Cells.Count > 0)
            {
                if (e.Row.Cells[0].Text.Contains(identifier))
                {
                    e.Row.Cells[0].ForeColor = Color.Red;
                    e.Row.Cells[1].ForeColor = Color.Red;
                    e.Row.Cells[2].ForeColor = Color.Red;
                    e.Row.Cells[3].ForeColor = Color.Red;
                }
            }
        }
    }
开发者ID:navkar,项目名称:BizTalkControlCenter,代码行数:34,代码来源:DV.aspx.cs


示例2: cmdCreate_Click

    protected void cmdCreate_Click(object sender, System.EventArgs e)
    {
        tbl.Controls.Clear();

        int rows = Int32.Parse(txtRows.Text);
        int cols = Int32.Parse(txtCols.Text);

        for (int i = 0; i < rows; i++)
        {
            TableRow rowNew = new TableRow();
            tbl.Controls.Add(rowNew);
            for (int j = 0; j < cols; j++)
            {
                TableCell cellNew = new TableCell();
                Label lblNew = new Label();
                lblNew.Text = "(" + i.ToString() + "," + j.ToString() + ")<br />";

                System.Web.UI.WebControls.Image imgNew = new System.Web.UI.WebControls.Image();
                imgNew.ImageUrl = "cellpic.png";

                cellNew.Controls.Add(lblNew);
                cellNew.Controls.Add(imgNew);

                if (chkBorder.Checked == true)
                {
                    cellNew.BorderStyle = BorderStyle.Inset;
                    cellNew.BorderWidth = Unit.Pixel(1);
                }

                rowNew.Controls.Add(cellNew);
            }
        }
    }
开发者ID:njmube,项目名称:ErpBapSoftNet_Producion,代码行数:33,代码来源:Default3.aspx.cs


示例3: buildAlertImage

        public static System.Web.UI.WebControls.Image buildAlertImage(AlertLevel level)
        {
            System.Web.UI.WebControls.Image res = new System.Web.UI.WebControls.Image();

            switch (level)
            {
                case AlertLevel.None:
                    res.ImageUrl = "~/img/ok.png";
                    res.AlternateText = "OK";
                    break;
                case AlertLevel.Warning:
                    res.ImageUrl = "~/img/warning.png";
                    res.AlternateText = "Warning";
                    break;
                case AlertLevel.Critical:
                default:
                    res.ImageUrl = "~/img/critical.png";
                    res.AlternateText = "Critical";
                    break;
            }

            res.BorderWidth = 0;
            res.Style["vertical-align"] = "middle";

            return res;
        }
开发者ID:ahorn,项目名称:z3test,代码行数:26,代码来源:Default.aspx.cs


示例4: SetSortImageStates

        /// <summary>
        /// Sets the sort image states.
        /// </summary>
        /// <param name="gridView">The grid view.</param>
        /// <param name="row">The row.</param>
        /// <param name="columnStartIndex"> </param>
        /// <param name="sortField">The sort field.</param>
        /// <param name="sortAscending">if set to <c>true</c> [sort ascending].</param>
        public static void SetSortImageStates(GridView gridView, GridViewRow row,int columnStartIndex, string sortField, bool sortAscending)
        {
            for (var i = columnStartIndex; i < row.Cells.Count; i++)
            {
                var tc = row.Cells[i];
                if (!tc.HasControls()) continue;

                // search for the header link  
                var lnk = tc.Controls[0] as LinkButton;
                if (lnk == null) continue;

                // initialize a new image
                var img = new Image
                {
                    ImageUrl = string.Format("~/images/{0}.png", (sortAscending ? "bullet_arrow_up" : "bullet_arrow_down")),
                    CssClass = "icon"
                };

                // setting the dynamically URL of the image
                // checking if the header link is the user's choice
                if (sortField == lnk.CommandArgument)
                {
                    // adding a space and the image to the header link
                    //tc.Controls.Add(new LiteralControl(" "));
                    tc.Controls.Add(img);
                }
            }
        }
开发者ID:ChuckLafferty,项目名称:bugnet,代码行数:36,代码来源:PresentationUtils.cs


示例5: Render

        public IEnumerable<object> Render(PanelItem panelItem)
        {
            if (panelItem.Type == PanelItemType.Image)
            {
                var image = new Image { ID = panelItem.GetId(), Enabled = false, Width = new Unit(panelItem.Width, UnitType.Pixel), CssClass = ItemStyle };

                panelItem.Target = image;

                return new object[] { image };
            }
            if (panelItem.Type == PanelItemType.InfoIcon)
            {
                var image = new Image
                {
                    ID = panelItem.GetId(),
                    ImageUrl = @"../images/info.png",
                    ToolTip = ResourceManager.GetString(panelItem.Text.IsNullOrEmpty() ? panelItem.GetPropertyName() + "Info" : panelItem.Text),
                    Enabled = false,
                    Width = new Unit(panelItem.Width, UnitType.Pixel),
                    CssClass = ItemStyle
                };

                panelItem.Target = image;

                return new object[] { image };
            }

            return null;
        }
开发者ID:erwinbovendeur,项目名称:ADF,代码行数:29,代码来源:ImageRenderer.cs


示例6: GetImagesPanel

        /// <summary>
        /// Gets a panel with all the image elements from a device within it.
        /// </summary>
        /// <param name="images"></param>
        /// <returns></returns>
        internal static Panel GetImagesPanel(KeyValuePair<string, Uri>[] images)
        {
            if (images != null)
            {
                Panel panel = new Panel();
                foreach (var hardwareImage in images)
                {
                    Panel item = new Panel();
                    item.Style.Add("float", "left");

                    Panel imagePanel = new Panel();

                    System.Web.UI.WebControls.Image image = new System.Web.UI.WebControls.Image();
                    image.ImageUrl = hardwareImage.Value.ToString();
                    image.Height = 128;
                    image.Width = 128;
                    imagePanel.Controls.Add(image);


                    Literal caption = new Literal();

                    caption.Text = String.Format("<h4 class=\"deviceImageCaption\">{0}</h4>", hardwareImage.Key);

                    item.Controls.Add(imagePanel);
                    item.Controls.Add(caption);

                    panel.Controls.Add(item);
                }
                return panel;
            }
            else
                return null;
        }
开发者ID:axle-h,项目名称:.NET-Device-Detection,代码行数:38,代码来源:DeviceImages.cs


示例7: Render

    protected override void Render(HtmlTextWriter output)
    {
      Assert.ArgumentNotNull(output, nameof(output));

      base.Render(output);

      //render other control
      var value = GetValue();

     
      if (!string.IsNullOrEmpty(value))
      {
        //get lat lng
        var position = value.Split(',');

        if (position.Count() == 2)
        {
          double lat = 0;
          double lng = 0;

          double.TryParse(position[0], out lat);
          double.TryParse(position[1], out lng);

          var mapImageCtrl = new Image();
          mapImageCtrl.ID = ID + "_Img_MapView";
          mapImageCtrl.CssClass = "imageMapView";
          mapImageCtrl.Width = mapWidth;
          mapImageCtrl.Height = mapHeight;
          mapImageCtrl.ImageUrl = GetMapImageUrl();
          mapImageCtrl.Style.Add("padding-top", "5px");

          mapImageCtrl.RenderControl(output);
        }     
      }
    }
开发者ID:chiragp,项目名称:Habitat,代码行数:35,代码来源:MapField.cs


示例8: lnkDownload_Click

 protected void lnkDownload_Click(object sender, EventArgs e)
 {
     System.Web.UI.WebControls.Image objImg = new System.Web.UI.WebControls.Image();
     objImg.
     objImg. = "handlethings.ashx?op=imagednld";
     Bitmap bmp2 = new Bitmap(objImg);
 }
开发者ID:sathi-natarajan,项目名称:WebAppSamples_CSharp,代码行数:7,代码来源:DownloadImages.aspx.cs


示例9: SetSortImageStates

        /// <summary>
        /// Sets the sort image states.
        /// </summary>
        /// <param name="gridView">The grid view.</param>
        /// <param name="row">The row.</param>
        /// <param name="sortField">The sort field.</param>
        /// <param name="sortAscending">if set to <c>true</c> [sort ascending].</param>
        public static void SetSortImageStates(GridView gridView, GridViewRow row,int columnStartIndex, string sortField, bool sortAscending)
        {
            for (int i = columnStartIndex; i < row.Cells.Count; i++)
            {
                TableCell tc = row.Cells[i];
                if (tc.HasControls())
                {
                    // search for the header link
                    LinkButton lnk = (LinkButton)tc.Controls[0];
                    if (lnk != null)
                    {
                        // initialize a new image
                        System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
                        // setting the dynamically URL of the image
                        img.ImageUrl = "~/images/" + (sortAscending ? "bullet_arrow_up" : "bullet_arrow_down") + ".png";
                        img.CssClass = "icon";
                        // checking if the header link is the user's choice
                        if (sortField == lnk.CommandArgument)
                        {
                            // adding a space and the image to the header link
                            //tc.Controls.Add(new LiteralControl(" "));
                            tc.Controls.Add(img);
                        }

                    }
                }
            }
        }
开发者ID:JackyW83,项目名称:Test,代码行数:35,代码来源:PresentationUtils.cs


示例10: MakeBracketCell

        /// <summary>
        /// Makes a bracket cell for a row.
        /// </summary>
        /// <param name="team">The team corressponding to the row the cell is being
        /// placed in.</param>
        /// <returns>The Bracket cell for the row.</returns>
        private TableCell MakeBracketCell(ContestTeam team)
        {
            TableCell bracketCell = new TableCell();
            bracketCell.HorizontalAlign = HorizontalAlign.Center;

            System.Web.UI.WebControls.Image bracketImage = new System.Web.UI.WebControls.Image();
            bracketImage.Width = new Unit("25px");
            bracketImage.Height = new Unit("25px");
            bracketImage.ImageAlign = ImageAlign.Middle;

            if (team.Bracket == (int)ContestBracket.Bronze)
            {
                bracketImage.ImageUrl = "~/Images/Competition/Contests/BronzeBracket.png";
            }
            else if (team.Bracket == (int)ContestBracket.Silver)
            {
                bracketImage.ImageUrl = "~/Images/Competition/Contests/SilverBracket.png";
            }
            else if (team.Bracket == (int)ContestBracket.Gold)
            {
                bracketImage.ImageUrl = "~/Images/Competition/Contests/GoldBracket.png";
            }
            else if (team.Bracket == (int)ContestBracket.Platinum)
            {
                bracketImage.ImageUrl = "~/Images/Competition/Contests/PlatinumBracket.png";
            }
            else
            {
                bracketImage.ImageUrl = "~/Images/Competition/Contests/DiamondBracket.png";
            }

            bracketCell.Controls.Add(bracketImage);;

            return bracketCell;
        }
开发者ID:mlcamilli,项目名称:ActivEarth,代码行数:41,代码来源:LeaderBoard.ascx.cs


示例11: btnGenerate_Click

        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            List<String> lstcode = new List<string>();
            //lstcode.Add(txtCode.Text);
            lstcode.Add("00271B7");
            //lstcode.Add("00533A7");
            //lstcode.Add("0056251");
            //lstcode.Add("00623D6");
            //lstcode.Add("007FF4C");
            //lstcode.Add("0085604");
            //lstcode.Add("009153D");
            //lstcode.Add("00947E7");
            //lstcode.Add("00A3631");

            //lstcode.Add("00C96DE");
            //lstcode.Add("00EB691");
            //lstcode.Add("00F3513");
            //lstcode.Add("010B183");
            //lstcode.Add("011DA5F");
            //lstcode.Add("0136BB5");
            //lstcode.Add("013ABFD");
            //lstcode.Add("013CFC7");
            //lstcode.Add("0142610");
            //lstcode.Add("0148237");
            //lstcode.Add("0151BA7");
            //lstcode.Add("0156796");
            //lstcode.Add("015AC84");
            //lstcode.Add("015C038");

            string barCode = txtCode.Text;

            foreach (string str in lstcode)
            {
                System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
                using (Bitmap bitMap = new Bitmap(str.Length * 40, 80))
                {
                    using (Graphics graphics = Graphics.FromImage(bitMap))
                    {
                        Font oFont = new Font("IDAutomationHC39M", 8);
                        PointF point = new PointF(2f, 2f);
                        SolidBrush blackBrush = new SolidBrush(Color.Black);
                        SolidBrush whiteBrush = new SolidBrush(Color.White);
                        graphics.FillRectangle(whiteBrush, 0, 0, bitMap.Width, bitMap.Height);
                        graphics.DrawString("*" + str + "*", oFont, blackBrush, point);
                    }
                    using (MemoryStream ms = new MemoryStream())
                    {
                        bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        byte[] byteImage = ms.ToArray();

                        Convert.ToBase64String(byteImage);
                        imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
                    }
                    plBarCode.Controls.Add(imgBarCode);
                }
            }
        }
开发者ID:SalesInventory,项目名称:SIMS,代码行数:57,代码来源:test.aspx.cs


示例12: RenderContents

        /// <summary>
        /// Renders the contents.
        /// </summary>
        /// <param name="output">The output.</param>
        protected override void RenderContents(HtmlTextWriter output)
        {
            System.Web.UI.WebControls.Image image = new System.Web.UI.WebControls.Image();

            int height = Convert.ToInt32(this.Height.Value);

            image.ImageUrl = string.Format("image.barcode?Type={0}&Code={1}&Height={2}", Type, Code, height);

            image.RenderControl(output);
        }
开发者ID:cmendesce,项目名称:asp-net-barcode,代码行数:14,代码来源:Barcode.cs


示例13: scrollImage

 private System.Web.UI.WebControls.Image scrollImage() {
     System.Web.UI.WebControls.Image functionReturnValue = null;
     functionReturnValue = new System.Web.UI.WebControls.Image();
     functionReturnValue.Width = Unit.Pixel(7);
     functionReturnValue.Height = Unit.Pixel(20);
     functionReturnValue.BorderWidth = Unit.Pixel(0);
     functionReturnValue.Attributes.Add("align", "absMiddle");
     functionReturnValue.CssClass = "editorArrow";
     functionReturnValue.Attributes.Add("onMouseOut", "this.className = 'editorArrow'; scrollStop();");
     return functionReturnValue;
 }
开发者ID:elrute,项目名称:Triphulcas,代码行数:11,代码来源:ScrollingMenu.cs


示例14: ImageButton1_Click

    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        // this is the folder where the uploaded files are saved
        string DefaultFileName = "";

        if (FileUploader.HasFile)
            try
            {
                //FileUploader.SaveAs(Server.MapPath(DefaultFileName) + FileUploader.FileName);

                FileUploader.SaveAs(Server.MapPath("~/Images/" + FileUploader.FileName));
                //string where = (Server.MapPath(DefaultFileName) + FileUploader.FileName);

                double punctX = 10;
                double punctY = 10;

                double spacing = 5;

                Panel2.Style["position"] = "relative";

                for (int y = 1; y < 3; y++)
                {
                    System.Web.UI.WebControls.Image image = new System.Web.UI.WebControls.Image();
                    //image.ID = "testjpg"; // +y.ToString();
                    image.Style["position"] = "absolute";
                    image.Style["left"] = punctX.ToString() + "px";
                    image.Style["top"] = punctY.ToString() + "px";
                    image.Width = 60;
                    //image.Height = 100;
                    //image.ImageUrl = (Server.MapPath(DefaultFileName) + FileUploader.FileName);
                    //image.ImageUrl = "Images/" + image.ID.ToString() + ".jpg";
                    image.ImageUrl = "Images/" + FileUploader.FileName.ToString();
                    //image.ImageUrl = Server.MapPath("~/Images/" + FileUploader.FileName);
                    Panel2.Controls.Add(image);
                    punctX += image.Width.Value + spacing;

                }

             DebugText.Text = "File name: " +
             FileUploader.PostedFile.FileName + "<br>" +
             FileUploader.PostedFile.ContentLength + " kb<br>" +
             "Content type: " +
             FileUploader.PostedFile.ContentType + "<br><b>Uploaded Successfully";

            }
            catch (Exception ex)
            {
                DebugText.Text = "ERROR: " + ex.Message.ToString();
            }
        else
        {
            DebugText.Text = "You have not specified a file.";
        }
    }
开发者ID:hansparsons,项目名称:SharePage,代码行数:54,代码来源:Default.aspx.cs


示例15: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            List<ProductDetailsBLL> lstProductDetails = ProductDetailsBLL.GetDetailByUser(1);
            if (lstProductDetails != null)
            {
                foreach (ProductDetailsBLL objProductDetailsBLL in lstProductDetails)
                {
                    System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
                    using (Bitmap bitMap = new Bitmap(objProductDetailsBLL.BarCodeNumber.Length * 17, 100))
                    {
                        using (Graphics graphics = Graphics.FromImage(bitMap))
                        {
                            Font oFont = new Font("IDAutomationHC39M", 6);
                            Font oFontCalibri = new Font("Calibri",12);

                            PointF point = new PointF(2f, 2f);
                            SolidBrush blackBrush = new SolidBrush(Color.Black);
                            SolidBrush whiteBrush = new SolidBrush(Color.White);

                            graphics.FillRectangle(whiteBrush, 0, 0, bitMap.Width, bitMap.Height);
                            graphics.DrawString("Size: " + objProductDetailsBLL.SizeName, oFontCalibri, blackBrush, 0, 44);
                            graphics.DrawString("MRP: " + objProductDetailsBLL.MRP, oFontCalibri, blackBrush, 0, 60);
                            graphics.DrawString("Code: " + objProductDetailsBLL.BarCodeNumber, oFontCalibri, blackBrush, 0, 76);
                            graphics.DrawString("*" + objProductDetailsBLL.BarCodeNumber + "*", oFont, blackBrush, point);
                        }
                        using (MemoryStream ms = new MemoryStream())
                        {
                            //PlaceHolder holder = new PlaceHolder();

                            //Label autoLabel = new Label();
                            //autoLabel.Text = "Name: " + objProductDetailsBLL.Name;
                            //holder.Controls.Add(autoLabel);

                            ////TextBox autoTextBox = new TextBox();
                            ////autoTextBox.Text = "" + id.ToString();
                            ////autoTextBox.ID = "TextBox" + id.ToString();
                            ////holder.Controls.Add(autoTextBox);

                            //holder.Controls.Add(new LiteralControl("&lt;br />"));

                            //imgBarCode.Controls.Add(holder);

                            bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                            byte[] byteImage = ms.ToArray();

                            Convert.ToBase64String(byteImage);
                            imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
                        }
                        plBarCode.Controls.Add(imgBarCode);
                    }
                }
            }
        }
开发者ID:SalesInventory,项目名称:SIMS,代码行数:53,代码来源:barcodeforprint.aspx.cs


示例16: CreateTooltipTable

        private static Table CreateTooltipTable(Control baseControl, string tooltip)
        {
            Table table = new Table();
            table.Rows.Add(new TableRow());
            table.Rows[0].Cells.Add(new TableCell());
            table.Rows[0].Cells[0].Controls.Add(baseControl);

            //string title = string.Format("Description for the '{0}' item", templateContainer.ViewItem.Caption);
            Image image = new Image() { ImageUrl = "/Images/questionmark.png", ToolTip = tooltip, BorderWidth = 0, CssClass = "tooltip-image" };
            //    image.Style["margin"] = "5px";
            table.Rows[0].Cells.Add(new TableCell());
            table.Rows[0].Cells[1].Controls.Add(image);
            return table;
        }
开发者ID:KrzysztofKielce,项目名称:xaf-tooltips,代码行数:14,代码来源:CustomLayoutTemplates.cs


示例17: AddImage

 /// <summary>Adds an image control to the container.</summary>
 /// <param name="container">The containing control.</param>
 /// <param name="item">The item containing image informatin.</param>
 /// <param name="detailName">The detail name on the item.</param>
 /// <param name="cssClass">The css class to applky to the image element.</param>
 /// <param name="altText">Alt alternative text to apply to the image element.</param>
 /// <returns>An image control.</returns>
 public static Control AddImage(Control container, ContentItem item, string detailName, string preferredSize, string cssClass, string altText)
 {
     string imageUrl = item[detailName] as string;
     if (!string.IsNullOrEmpty(imageUrl))
     {
         Image image = new Image();
         image.ImageUrl = ImagesUtility.GetExistingImagePath(imageUrl, preferredSize);
         image.AlternateText = item.GetDetail(detailName + "_AlternateText", altText);
         image.CssClass = item.GetDetail(detailName + "_CssClass", cssClass);
         container.Controls.Add(image);
         return image;
     }
     return null;
 }
开发者ID:AnonymousRetard,项目名称:n2cms,代码行数:21,代码来源:DisplayableImageAttribute.cs


示例18: AddImage

 /// <summary>Adds an image control to the container.</summary>
 /// <param name="container">The containing control.</param>
 /// <param name="item">The item containing image informatin.</param>
 /// <param name="detailName">The detail name on the item.</param>
 /// <param name="cssClass">The css class to applky to the image element.</param>
 /// <param name="altText">Alt alternative text to apply to the image element.</param>
 /// <returns>An image control.</returns>
 public static Control AddImage(Control container, ContentItem item, string detailName, string cssClass, string altText)
 {
     string imageUrl = item[detailName] as string;
     if (!string.IsNullOrEmpty(imageUrl))
     {
         Image image = new Image();
         image.ImageUrl = N2.Web.Url.ToAbsolute(imageUrl);
         image.Attributes["alt"] = altText;
         image.CssClass = cssClass;
         container.Controls.Add(image);
         return image;
     }
     return null;
 }
开发者ID:spmason,项目名称:n2cms,代码行数:21,代码来源:DisplayableImageAttribute.cs


示例19: CreateChildControls

        /// <summary>
        ///   Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            // Resized Image
            _imageResizerImage = new Image();

            // Label
            _imageResizerLabel = new Literal { Text = string.Empty };

            _propertyAlias = new HiddenField();

            Controls.Add(_imageResizerImage);
            Controls.Add(_imageResizerLabel);
            Controls.Add(_propertyAlias);
        }
开发者ID:ZeeshanShafqat,项目名称:Aspose_Imaging_NET,代码行数:19,代码来源:ImageResizerDataEditor.cs


示例20: Render

 protected override void Render(HtmlTextWriter output)
 {
     double num4 = this.TableWidth.Value;
     double num = Math.Round((double) ((70.0 * num4) / 100.0));
     double num2 = Math.Round((double) ((this.RatingPercent * num) / 100.0));
     double num3 = Math.Round((double) (num - num2));
     Table child = new Table();
     TableRow row = new TableRow();
     TableRow row2 = new TableRow();
     TableCell cell = new TableCell();
     TableCell cell2 = new TableCell();
     TableCell cell3 = new TableCell();
     row2.ControlStyle.CopyFrom(this.ItemStyle);
     cell.ColumnSpan = 2;
     if (this.Rating == 0.0)
     {
         cell.Text = string.Format(ResourceManager.GetString("RatingResults"), this.Rating, this.MaxRating);
     }
     else
     {
         cell.Text = string.Format(ResourceManager.GetString("RatingResults"), this.Rating.ToString("##.##"), this.MaxRating);
     }
     row2.Cells.Add(cell);
     child.Rows.Add(row2);
     cell3.ControlStyle.Font.Size = FontUnit.XXSmall;
     cell3.Text = "&nbsp;" + this.MaxRating.ToString();
     child.CellPadding = 0;
     child.CellSpacing = 3;
     child.BorderWidth = 0;
     child.Width = Unit.Pixel((int) num);
     System.Web.UI.WebControls.Image image = new System.Web.UI.WebControls.Image();
     image.ImageUrl = GlobalConfig.ImagesPath + "PositiveRatingBar.gif";
     image.Width = Unit.Pixel((int) num2);
     image.Height = 12;
     cell2.Controls.Add(image);
     image = new System.Web.UI.WebControls.Image();
     image.ImageUrl = GlobalConfig.ImagesPath + "NegativeRatingBar.gif";
     image.Width = Unit.Pixel((int) num3);
     image.Height = 12;
     cell2.Controls.Add(image);
     row.ControlStyle.CopyFrom(this.ItemStyle);
     row.Cells.Add(cell2);
     row.Cells.Add(cell3);
     child.Controls.Add(row);
     this.Controls.Add(child);
     child.RenderControl(output);
 }
开发者ID:ChrisNelsonPE,项目名称:surveyproject_main_public,代码行数:47,代码来源:RatingBar.cs



注:本文中的System.Web.UI.WebControls.Image类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.ImageButton类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.HyperLink类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap