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

Revision 5922, 1.3 KB checked in by kakinaka, 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 * Copyright ¢í 2000-2006 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
25
26/* ²èÁü¤Ë¥Æ¥­¥¹¥È¤òÉÁ²è¤¹¤ë */
27function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) {
28    $color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]);
29    $text = mb_convert_encoding($text, "UTF-8", "EUC-JP");
30    // ɽ¼¨³ÑÅÙ
31    $angle = 0;
32    // ¥Æ¥­¥¹¥ÈÉÁ²è
33    ImageTTFText($dst_image, $font_size, $angle, $left, $top, $color, $font, $text);
34}
35
36// ɽ¼¨¿§¤Î¼èÆÀ
37function lfGetImageColor($image, $array) {
38    if(count($array) != 3) {
39        return NULL;
40    }
41    $ret = imagecolorallocate($image, $array[0], $array[1], $array[2]);
42    return $ret;
43}
44
45// ±ÆÍÑɽ¼¨¿§¤Î¼èÆÀ
46function lfGetImageDarkColor($image, $array) {
47    if(count($array) != 3) {
48        return NULL;
49    }
50    $i = 0;
51    foreach($array as $val) {
52        $dark[$i] = $val - 45;
53        if($dark[$i] < 0) {
54            $dark[$i] = 0;
55        }
56        $i++;
57    }
58    $ret = imagecolorallocate($image, $dark[0], $dark[1], $dark[2]);
59    return $ret;
60}
61?>
Note: See TracBrowser for help on using the repository browser.