source: temp/trunk/html/admin/total/class/lib.php @ 1328

Revision 1328, 1.2 KB checked in by naka, 20 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2
3// ±ß¤ÎÃæ¿´ÅÀ¤Èľ·Â¤«¤é¸Ì¤Î½ªÃ¼ºÂɸ¤ò»»½Ð¤¹¤ë¡£
4/*
5    $cx : Ãæ¿´ÅÀXºÂɸ
6    $cy : Ãæ¿´ÅÀYºÂɸ
7    $r  : Ⱦ·Â
8    $e  : ³ÑÅÙ
9*/
10function lfGetArcPos($cx, $cy, $cw, $ch, $e) {
11    // »°³Ñ´Ø¿ôÍѤγÑÅÙ¤òµá¤á¤ë
12    $s = 90 - $e;
13    $r = $cw / 2;
14    // °ÌÃÖ¤òµá¤á¤ë
15    $x = $cx + ($r * cos(deg2rad($s)));
16    $y = $cy - (($r * sin(deg2rad($s))) * ($ch / $cw));     
17    return array(round($x), round($y));
18}
19
20
21
22/* ²èÁü¤Ë¥Æ¥­¥¹¥È¤òÉÁ²è¤¹¤ë */
23function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) {
24    $color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]);
25    $text = mb_convert_encoding($text, "UTF-8", "EUC-JP");
26    // ɽ¼¨³ÑÅÙ
27    $angle = 0;
28    // ¥Æ¥­¥¹¥ÈÉÁ²è
29    ImageTTFText($dst_image, $font_size, $angle, $left, $top, $color, $font, $text);
30}
31
32// ɽ¼¨¿§¤Î¼èÆÀ
33function lfGetImageColor($image, $array) {
34    if(count($array) != 3) {
35        return NULL;
36    }
37    $ret = imagecolorallocate($image, $array[0], $array[1], $array[2]);
38    return $ret;
39}
40
41// ±ÆÍÑɽ¼¨¿§¤Î¼èÆÀ
42function lfGetImageDarkColor($image, $array) {
43    if(count($array) != 3) {
44        return NULL;
45    }
46    $i = 0;
47    foreach($array as $val) {
48        $dark[$i] = $val - 45;
49        if($dark[$i] < 0) {
50            $dark[$i] = 0;
51        }
52        $i++;
53    }
54    $ret = imagecolorallocate($image, $dark[0], $dark[1], $dark[2]);
55    return $ret;
56}
57?>
Note: See TracBrowser for help on using the repository browser.