source: branches/comu/html/admin/total/class/lib.php @ 11730

Revision 11730, 1.3 KB checked in by nanasess, 17 years ago (diff)

r11729 の変更を取消

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