當前位置: 首頁>>代碼示例>>PHP>>正文


PHP image::saveImage方法代碼示例

本文整理匯總了PHP中image::saveImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP image::saveImage方法的具體用法?PHP image::saveImage怎麽用?PHP image::saveImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在image的用法示例。


在下文中一共展示了image::saveImage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: image

<?php

include 'image.class.php';
$image = new image(320, 200);
for ($i = 1; $i <= 15; $i++) {
    $image->drawFilledRectangle(10 + 10 * $i, 170 - 10 * $i, 30 + 10 * $i, 190 - 10 * $i, '0000ff50');
}
for ($i = 1; $i <= 15; $i++) {
    $image->drawFilledRectangle(110 + 10 * $i, 170 - 10 * $i, 130 + 10 * $i, 190 - 10 * $i, '0000ff50');
}
for ($i = 1; $i <= 15; $i++) {
    $image->drawFilledRectangle(10 + 10 * $i, 10 + 10 * $i, 30 + 10 * $i, 30 + 10 * $i, 'ff000050');
}
for ($i = 1; $i <= 15; $i++) {
    $image->drawFilledRectangle(110 + 10 * $i, 10 + 10 * $i, 130 + 10 * $i, 30 + 10 * $i, 'ff000050');
}
$image->saveImage('demo.png');
echo "<img hspace='0' vspace='0' src='demo.png' border='0'>";
開發者ID:kumarsivarajan,項目名稱:ctrl-dock,代碼行數:18,代碼來源:demo.image.class.php

示例2: uploader

    $uploader = new uploader();
    $uploader->checkAndMove();
}
if (!empty($_SESSION['filename'])) {
    $image = new image();
    $image->getDimensions();
    if (!empty($_POST['imageCrop'])) {
        $image->cropImage();
    }
}
?>
</head>
<body>
<center>
<h1>Загрузка и обработка изображения</h1>
<?php 
$menu->showUploadMenu();
if (!empty($_SESSION['filename'])) {
    $menu->showCropMenu();
    $image->checkCrop($menu);
    $menu->showSepia();
    if (!empty($_GET['sepia']) and $_GET['sepia'] == 'yes') {
        $image->applySepia();
    }
    $image->showImage();
    $image->saveImage();
}
?>
</center>
</body>
</html>
開發者ID:dmitrii89,項目名稱:PHP_image_processing,代碼行數:31,代碼來源:index.php

示例3: image

$image->saveImage('test_03.png');
echo "<img hspace='2' vspace='2' src='test_03.png' border='0'>";
echo "<hr />";
echo "<p>draw a red alpha transparent filled box</p>";
$image = new image(50, 50);
$image->drawFilledRectangle(5, 5, 45, 45, 'ff000050');
$image->saveImage('test_04.png');
echo "<img hspace='2' vspace='2' src='test_04.png' border='0'>";
echo "<hr />";
echo "<p>draw a red alpha transparent filled blue bordered box with a border of 4 pixels</p>";
$image = new image(50, 50);
$image->drawFilledBorderedRectangle(5, 5, 45, 45, 4, '00007f50', 'ff000050');
$image->saveImage('test_05.png');
echo "<img hspace='2' vspace='2' src='test_05.png' border='0'>";
echo "<hr />";
echo "<p>draw a red alpha transparent filled blue bordered box.  The border will increase in size from 0 to 10 pixels pixels for the border and some white text in the box</p>";
for ($i = 0; $i <= 10; $i++) {
    $image = new image(200, 50);
    $image->drawFilledBorderedRectangle(0, 0, 200, 50, $i, '00007f50', 'ff000050');
    $image->addFont('verdana.ttf');
    $image->drawText(4, 14, 0, 'verdana.ttf', 12, 'ffffff00', 'Some text');
    $image->saveImage("test_06_" . $i . ".png");
    echo "<img hspace='2' vspace='2' src='test_06_" . $i . ".png' border='0'></br >";
}
echo "<hr />";
echo "<p>draw a red and blue alpha transparent box that overlap.  This demonstrates the alpha blending of the images</p>";
$image = new image(50, 50);
$image->drawFilledRectangle(5, 5, 30, 30, 'ff000050');
$image->drawFilledRectangle(20, 20, 45, 45, '0000ff50');
$image->saveImage('test_07.png');
echo "<img hspace='2' vspace='2' src='test_07.png' border='0'>";
開發者ID:kumarsivarajan,項目名稱:ctrl-dock,代碼行數:31,代碼來源:test.image.class.php


注:本文中的image::saveImage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。