php儲存圖片,該如何解決

來源:互聯網
上載者:User
php儲存圖片
我用jpgraph產生畫布,輸入畫布,但是把圖片不能儲存成功,運行程式也沒有錯誤提示。
//用PHP畫折線圖
include("E:/phpser/AppServ/jpgraph/jpgraph/jpgraph.php");
include("E:/phpser/AppServ/jpgraph/jpgraph/jpgraph_line.php");
$datay=$pm25;
$graph = new Graph(700,300,"auto"); //產生畫布
$graph->img->SetMargin(50,40,30,40); //設定畫布的邊距
$graph->img->SetAntiAliasing(); //設定拆線的平滑狀態
$graph->SetScale("textlin"); //設定刻度樣式
$graph->SetShadow();//建立畫布陰影
$graph->title->Set("最近24小時pm2.5值的變化");//設定標題
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);//設定標題字型
$graph->SetMarginColor("lightblue");//設定畫布的背景顏色為淡藍色
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD);//設定Y軸標題的字型
$graph->xaxis->SetPos("min");
$graph->yaxis->HideZeroLabel();
$graph->ygrid->SetFill(true,[email protected]',[email protected]');
$graph->xaxis->SetTickLabels($a);
$graph->xaxis->SetFont(FF_SIMSUN); //設定X座標軸的字型
$graph->yscale->SetGrace(20);
$p1 = new LinePlot($datay); //建立折線圖對象
$p1->mark->SetType(MARK_FILLEDCIRCLE); //設定資料座標點為圖形標記
$p1->mark->SetFillColor("red"); //設定填充的顏色
$p1->mark->SetWidth(4); //設定圓柱形標記的直徑為4像素
$p1->mark->SetColor("blue"); //設定拆線顏色為藍色
$p1->SetCenter(); //在X軸的各座標點中心位置繪製拆線
[color=#FF0000]$graph->Add($p1); //在統計圖上繪製折線
//$graph->Stroke(); //輸出映像
$graph->Stroke('C:/AppServ/www/pm25/1.jpg");
------解決思路----------------------

$graph->Stroke(); //輸出映像
時有圖片顯示嗎?
------解決思路----------------------
不懂啊,在學習,加油吧!!
------解決思路----------------------
有什麼錯誤提示?
儲存圖片的路徑是否可寫?

------解決思路----------------------
不報錯,不等於沒有錯
你只能跟蹤進去看看是什麼地方出了問題
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.