示例#1
0
 function awMingDriver()
 {
     parent::awDriver();
     $this->driverString = 'ming';
     // Nice defaults
     ming_setScale(20.0);
     ming_useswfversion(6);
 }
示例#2
0
 public function __construct()
 {
     parent::__construct();
     $this->driverString = 'ming';
     // Nice defaults
     ming_setScale(20.0);
     ming_useswfversion(6);
 }
示例#3
0
 public function InitLib()
 {
     // 2. Ming 라이브러리 초기화..
     Ming_setScale(20.0);
     ming_useswfversion(7);
     $this->m_oMovie = new SWFMovie();
     $this->GetImageSize();
     $this->m_oMovie->setDimension($this->m_Width, $this->m_Height);
     $this->m_oMovie->setRate($this->FRAMES);
     $this->m_oMovie->setBackground(255, 255, 255);
 }
示例#4
0
 private function _flash()
 {
     $spacing = 5;
     $codewidth = ($this->width - $spacing * 5) / 4;
     $strforswdaction = '';
     for ($i = 0; $i <= 3; $i++) {
         $strforswdaction .= $this->swfcode($codewidth, $spacing, $this->_code[$i], $i + 1);
     }
     ming_setScale(20.0);
     ming_useswfversion(6);
     $movie = new SWFMovie();
     $movie->setDimension($this->width, $this->height);
     $movie->setBackground(255, 255, 255);
     $movie->setRate(31);
     $fontcolor = '0x' . sprintf('%02s', dechex(mt_rand(0, 255))) . sprintf('%02s', dechex(mt_rand(0, 128))) . sprintf('%02s', dechex(mt_rand(0, 255)));
     $strAction = "\n\t\t_root.createEmptyMovieClip ( 'triangle', 1 );\n\t\twith ( _root.triangle ) {\n\t\tlineStyle( 3, {$fontcolor}, 100 );\n\t\t{$strforswdaction}\n\t\t}\n\t\t";
     $movie->add(new SWFAction(str_replace("\r", "", $strAction)));
     header('Content-type: application/x-shockwave-flash');
     $movie->output();
 }
示例#5
0
            imagepng($im);
        } else {
            dheader('Content-type: image/jpeg');
            imagejpeg($im, '', 100);
        }
        imagedestroy($im);
    }
} elseif ($seccodedata['type'] == 2 && extension_loaded('ming')) {
    $spacing = 5;
    $codewidth = ($seccodedata['width'] - $spacing * 5) / 4;
    $strforswdaction = '';
    for ($i = 0; $i <= 3; $i++) {
        $strforswdaction .= seccode_swfcode($codewidth, $spacing, $seccode[$i], $i + 1);
    }
    ming_setScale(20.0);
    ming_useswfversion(6);
    $movie = new SWFMovie();
    $movie->setDimension($seccodedata['width'], $seccodedata['height']);
    $movie->setBackground(255, 255, 255);
    $movie->setRate(31);
    $fontcolor = '0x' . sprintf('%02s', dechex(mt_rand(0, 255))) . sprintf('%02s', dechex(mt_rand(0, 128))) . sprintf('%02s', dechex(mt_rand(0, 255)));
    $strAction = "\r\n\t_root.createEmptyMovieClip ( 'triangle', 1 );\r\n\twith ( _root.triangle ) {\r\n\tlineStyle( 3, {$fontcolor}, 100 );\r\n\t{$strforswdaction}\r\n\t}\r\n\t";
    $movie->add(new SWFAction(str_replace("\r", "", $strAction)));
    header('Content-type: application/x-shockwave-flash');
    $movie->output();
} else {
    $numbers = array('B' => array('00', 'fc', '66', '66', '66', '7c', '66', '66', 'fc', '00'), 'C' => array('00', '38', '64', 'c0', 'c0', 'c0', 'c4', '64', '3c', '00'), 'E' => array('00', 'fe', '62', '62', '68', '78', '6a', '62', 'fe', '00'), 'F' => array('00', 'f8', '60', '60', '68', '78', '6a', '62', 'fe', '00'), 'G' => array('00', '78', 'cc', 'cc', 'de', 'c0', 'c4', 'c4', '7c', '00'), 'H' => array('00', 'e7', '66', '66', '66', '7e', '66', '66', 'e7', '00'), 'J' => array('00', 'f8', 'cc', 'cc', 'cc', '0c', '0c', '0c', '7f', '00'), 'K' => array('00', 'f3', '66', '66', '7c', '78', '6c', '66', 'f7', '00'), 'M' => array('00', 'f7', '63', '6b', '6b', '77', '77', '77', 'e3', '00'), 'P' => array('00', 'f8', '60', '60', '7c', '66', '66', '66', 'fc', '00'), 'Q' => array('00', '78', 'cc', 'cc', 'cc', 'cc', 'cc', 'cc', '78', '00'), 'R' => array('00', 'f3', '66', '6c', '7c', '66', '66', '66', 'fc', '00'), 'T' => array('00', '78', '30', '30', '30', '30', 'b4', 'b4', 'fc', '00'), 'V' => array('00', '1c', '1c', '36', '36', '36', '63', '63', 'f7', '00'), 'W' => array('00', '36', '36', '36', '77', '7f', '6b', '63', 'f7', '00'), 'X' => array('00', 'f7', '66', '3c', '18', '18', '3c', '66', 'ef', '00'), 'Y' => array('00', '7e', '18', '18', '18', '3c', '24', '66', 'ef', '00'), '2' => array('fc', 'c0', '60', '30', '18', '0c', 'cc', 'cc', '78', '00'), '3' => array('78', '8c', '0c', '0c', '38', '0c', '0c', '8c', '78', '00'), '4' => array('00', '3e', '0c', 'fe', '4c', '6c', '2c', '3c', '1c', '1c'), '6' => array('78', 'cc', 'cc', 'cc', 'ec', 'd8', 'c0', '60', '3c', '00'), '7' => array('30', '30', '38', '18', '18', '18', '1c', '8c', 'fc', '00'), '8' => array('78', 'cc', 'cc', 'cc', '78', 'cc', 'cc', 'cc', '78', '00'), '9' => array('f0', '18', '0c', '6c', 'dc', 'cc', 'cc', 'cc', '78', '00'));
    foreach ($numbers as $i => $number) {
        for ($j = 0; $j < 6; $j++) {
            $a1 = substr('012', mt_rand(0, 2), 1) . substr('012345', mt_rand(0, 5), 1);
            $a2 = substr('012345', mt_rand(0, 5), 1) . substr('0123', mt_rand(0, 3), 1);
示例#6
0
         }
         if ($idy > $maxy) {
             $maxy = $idy;
         }
     }
 }
 $widthx = $maxx - $minx;
 $widthy = $maxy - $miny;
 $cellw = 70;
 $cellh = 30;
 $celltmargin = 20;
 $celllmargin = 10;
 $imgwx = $cellw * ($widthx + 2);
 $imgwy = $cellh * ($widthy + 2);
 Ming_setScale(20.0);
 ming_useswfversion(5);
 $m = new SWFMovie();
 $m->setDimension($imgwx, $imgwy);
 $font = new SWFFont("img/Arial.fdb");
 $connections = new SWFShape();
 foreach ($map as $idx => $x) {
     foreach ($x as $idy => $device) {
         $celx = $idx - $minx;
         $cely = $idy - $miny;
         if (preg_match('/^n/', $device)) {
             $device = str_replace('n', '', $device);
             list($nodeid, $device, $linktype) = explode('.', $device);
             $nodemap[$nodeid]['x'] = $celx;
             $nodemap[$nodeid]['y'] = $cely;
             $nodemap[$nodeid]['device'] = $device;
             $nodemap[$nodeid]['linktype'] = $linktype;
示例#7
0
<?php

ming_useswfversion(4);
$s = new SWFShape();
$f = $s->addFill(0xff, 0, 0);
$s->setRightFill($f);
$s->movePenTo(-500, -500);
$s->drawLineTo(500, -500);
$s->drawLineTo(500, 500);
$s->drawLineTo(-500, 500);
$s->drawLineTo(-500, -500);
$p = new SWFSprite();
$i = $p->add($s);
$i->setDepth(1);
$p->nextFrame();
for ($n = 0; $n < 5; ++$n) {
    $i->rotate(-15);
    $p->nextFrame();
}
$m = new SWFMovie();
$m->setBackground(0xff, 0xff, 0xff);
$m->setDimension(6000, 4000);
$i = $m->add($p);
$i->setDepth(1);
$i->moveTo(-500, 2000);
$i->setName("box");
$m->add(new SWFAction("/box.x += 3;"));
$m->nextFrame();
$m->add(new SWFAction("gotoFrame(0); play();"));
$m->nextFrame();
header('Content-type: application/x-shockwave-flash');
示例#8
0
文件: bitmaps.php 项目: omyyalliu/web
<?php

Ming_setScale(20.0);
ming_useswfversion(7);
$movie = new SWFMovie();
$movie->setRate(31);
$movie->setDimension(400, 300);
$movie->setBackground(0xcc, 0xcc, 0xcc);
$filesrc1 = "jpg.jpg";
$filesrc2 = "png.png";
$filesrc3 = "gif.gif";
$filecontents1 = file_get_contents($filesrc1);
$img = new SWFBitmap($filecontents1);
$f1 = $movie->add($img);
$f1->moveto(90, 50);
$filecontents2 = file_get_contents($filesrc2);
$img = new SWFBitmap($filecontents2);
$f1 = $movie->add($img);
$f1->moveto(10, 10);
$filecontents3 = file_get_contents($filesrc3);
$img = new SWFBitmap($filecontents3);
$f1 = $movie->add($img);
$f1->moveto(170, 80);
header('Content-Type: application/x-shockwave-flash');
$movie->output(0);