| 1 |
<?php |
| 2 |
$oGraphic = new COM('PhotoSprite.Graphic'); |
| 3 |
|
| 4 |
$oGraphic->SourceFile = dirname(__FILE__).str_replace('/', '\\', '/images/demo.jpg'); |
| 5 |
$oGraphic->DestFile = dirname(__FILE__).str_replace('/', '\\', '/images/tmp/crop.jpg'); |
| 6 |
|
| 7 |
$oGraphic->CropShape = "Rectangle"; |
| 8 |
$oGraphic->X = 70; |
| 9 |
$oGraphic->Y = 25; |
| 10 |
$oGraphic->Width = 260; |
| 11 |
$oGraphic->Height = 240; |
| 12 |
|
| 13 |
// $oGraphic->CropShape = "Square"; |
| 14 |
// $oGraphic->X = 70; |
| 15 |
// $oGraphic->Y = 30; |
| 16 |
// $oGraphic->Width = 240; |
| 17 |
|
| 18 |
// $oGraphic->CropShape = "Ellipse"; |
| 19 |
// $oGraphic->X = 70; |
| 20 |
// $oGraphic->Y = 30; |
| 21 |
// $oGraphic->Width = 260; |
| 22 |
// $oGraphic->Height = 240; |
| 23 |
|
| 24 |
// $oGraphic->CropShape = "Circle"; |
| 25 |
// $oGraphic->X = 70; |
| 26 |
// $oGraphic->Y = 30; |
| 27 |
// $oGraphic->Width = 250; |
| 28 |
|
| 29 |
$oGraphic->Crop(); |
| 30 |
|
| 31 |
print('<img src="images/demo.jpg" border="0">'); |
| 32 |
print('<img src="images/tmp/crop.jpg" border="0">'); |
| 33 |
?> |
| 34 |
|