小编php*_*net的帖子

如何在c#中绘制圆角矩形

我正在使用此代码来制作圆角矩形.但它只绘制了rectanlge的左上角和右上角,更不能完成下部的矩形.如何使其完整和充实.我应该做些什么改变?

public static Bitmap DrawRoundedRectangle(Bitmap Image, Color BoxColor, int XPosition, int YPosition,
        int Height, int Width, int CornerRadius)
    {
     Bitmap NewBitmap = new Bitmap(Image, Image.Width, Image.Height);
     using (Graphics NewGraphics = Graphics.FromImage(NewBitmap))
    {
        using (Pen BoxPen = new Pen(BoxColor))
        {
            using (GraphicsPath Path = new GraphicsPath())
            {
                   Path.AddLine(XPosition + CornerRadius, YPosition, XPosition + Width - (CornerRadius * 2), YPosition);
                    Path.AddArc(XPosition + Width - (CornerRadius * 2), YPosition, CornerRadius * 2, CornerRadius * 2, 270, 90);
                  Path.AddLine(XPosition + Width, YPosition + CornerRadius, …
Run Code Online (Sandbox Code Playgroud)

c# graphics drawing rectangles winforms

17
推荐指数
2
解决办法
2万
查看次数

如何为外部系列ZingChart中的绘图值设置颜色

如何在zingchart中为系列数组外的不同值集设置不同的背景颜色?应该在哪里以及如何为值set1和value set2设置background-color-1

var myConfig = {
    type: "mixed", 
    series : [
        {
          type : 'bar',
            values : [35,42,67,89,25,34,67,85],
            values : [30,40,60,80],
           // how to change background color without setting it here ?

        },
        {
          type : 'line',
            values : [35,42,67,89,25,34,67,85],
            lineWidth : "6px",
            topState : {
              lineWidth : "2px",
              lineColor : "pink"
            }
        }
    ]
};
Run Code Online (Sandbox Code Playgroud)

json zingchart

8
推荐指数
1
解决办法
177
查看次数

ZingChart如何在一段时间后加载最新数据并更新图表

我正在使用ZingChart.在加载页面时,图表成功加载MySql数据库中的数据.但是在数据库更新一段时间后如何加载最新数据?请帮帮我.我在index.php页面中尝试了以下代码来执行此操作,但它不起作用.

<script>
  
   var myData=[
	<?php


$conn =mysql_connect("localhost","root","") or die ("we couldn't connect!");
mysql_select_db("webauth");
$rs = mysql_query("SELECT * FROM test") or die(mysql_error());
 while($row = mysql_fetch_array($rs))
 {
        echo $row['label'].',';
 }?>];
   
    var myLabels=[<?php


$conn =mysql_connect("localhost","root","") or die ("we couldn't connect!");
mysql_select_db("webauth");
$rs = mysql_query("SELECT * FROM test") or die(mysql_error());
 while($row2 = mysql_fetch_array($rs))
 {
        echo '"'.$row2['value'].'"'.',';
 }?>];



window.onload=function(){
	

	
	window.alert(myData);
	 zingchart.render({
	   id:'chartDiv',
  
  data:{
        "type":"bar",
		
        "scale-x":{
            "values":myLabels,
        },
        "series":[
            {
                "values":myData
            }
    ]
	,
	  "refresh":{
    "type":"feed",
    "transport":"http",
    "url":"feed.php?",
    "interval":200
		},
    }
    });

}
</script> …
Run Code Online (Sandbox Code Playgroud)

javascript php mysql zingchart

5
推荐指数
1
解决办法
878
查看次数

为什么线程会增加 C# 的执行时间

使用两个线程打印数字,这会增加时间,然后使用单循环打印我知道同步会增加时间,但在我的代码中如何增加时间并停止线程打印重复的数字?到底有吗?

class Program
{
    public static int count=0;
    public static List<string> numbers = new List<string>();
    public static int semaphore=0;

    static void Main(string[] args)
    {
        for (int i = 0; i < 10; i++)
        {
            numbers.Add(i.ToString());
        }

       Console.WriteLine("Before start thread");

       Thread tid1 = new Thread(new ThreadStart(MyThread.Thread1));
       Thread tid2 = new Thread(new ThreadStart(MyThread.Thread1));

       tid1.Start();
       tid2.Start();
    }
}
  public class MyThread
{
    public static object locker = new object();

    public static void Thread1()
    {
        for (; Program.count < Program.numbers.Count;)
        {
            lock (locker)
            { …
Run Code Online (Sandbox Code Playgroud)

c# multithreading

-3
推荐指数
1
解决办法
2547
查看次数