메뉴 건너뛰기

조회 수 389 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

<?

$fontsize = 30;

$string = "admin";

$font = './ARIALUNI_3.TTF';

$im = imagecreate(150, 150);

// White background and blue text

$bg = imagecolorallocate($im, 255, 255, 255);

$textcolor = imagecolorallocatealpha($im, 100, 100, 100, 100);

// Write the string at the top left

imagestring($im, $fontsize, 0, 0, $string, $textcolor);

//imagettftext($im, $fontsize, 0, 0, $fontsize, $textcolor, $font, $string);

// Output the image

//header('Content-type: image/png');

$im = imagerotate($im,45,0);

$target = "./test1.png";

imagepng($im, $target, 9);

# 출력 후 이미지를 메모리에서 지운다.

imagedestroy($im);

?>

<img src="<?=$target?>">

/////////////////////////////////////////////////////////////////////////////

<?php

// watermark.php

# 접속자 IP 주소를 불러온다.

$text = "admin";

# 이미지를 생성한다.

# imagecreate(int width, int height);

$im = imagecreate(360, 300);

# 이미지 배경색을 설정한다.

# imagecolorallocate(생성 이미지, int red, int green, int blue, int alpha);

# RGB 색상 범위는 0~255 / alpha 범위는 0~127(투명)

$bg = imagecolorallocatealpha($im, 100, 100, 100, 127);

# PNG로 내보내기 위해 헤더를 설정한다.

//header("Content-Type: image/png");

# 개수를 바꾸려면 '$i <= 10;'의 10을 줄이거나 늘리면 된다.

 # 삽입할 글자(IP 주소)의 색을 설정한다.

 # rand();를 사용해 글자색과 알파값을 무작위로 나오게 했다.

 $tc = imagecolorallocatealpha($im, 100, 100, 100, 100);

 # 이미지에 글자(IP 주소)를 넣는다.

 # imagestring(생성 이미지, 글자크기[1-5], 가로위치, 세로위치, 표시할 문자, 글자색);

 # rand();를 사용해 글자가 표시될 위치를 무작위로 나오게 했다.

 imagestring($im, 15, 100, 100, $text, $tc);

# 만든 이미지를 PNG로 내보내 출력한다.

# imagepng(생성 이미지, 저장할 경로, 압축률, 필터);

# 경로를 지정하지 않으면 NULL, 압축률은 0~9

# 경로, 압축률, 필터는 생략해도 된다.

$target = "./test.png";

imagepng($im, $target, 9);

# 출력 후 이미지를 메모리에서 지운다.

imagedestroy($im);

?>

<img src="<?=$target?>">


  1. 링크 클릭시 특정영역에 페이지 불러오기 (아이프레임X)

    Date2019.12.13 Views1223
    Read More
  2. 그누보드5 검색최적화 방법입니다

    Date2019.04.29 Views876
    Read More
  3. 영카트5 DB 테이블별로 덤프하기

    Date2019.04.29 Views864
    Read More
  4. 쉽고 간편한 인쇄 팁

    Date2019.04.29 Views743
    Read More
  5. 회원 목록을 select 로 불러와서 선택시 input 에 집어넣기

    Date2019.12.13 Views588
    Read More
  6. 네이버 밴드 글 가져오기

    Date2019.12.13 Views485
    Read More
  7. '정상적으로 로그인하여 접근하시기 바랍니다.' 해결 방법

    Date2020.12.09 Views426
    Read More
  8. 이미지에 워터마크 넣기

    Date2019.12.13 Views389
    Read More
  9. iframe 금지된 사이트 iframe 으로 불러오기

    Date2019.12.13 Views385
    Read More
  10. 우측 퀵메뉴

    Date2019.12.13 Views382
    Read More
  11. 특정 게시판에서 이미지 파일만 업로드 허용하기

    Date2019.12.09 Views367
    Read More
  12. fullcalendar 달력 게시판 스킨

    Date2021.03.24 Views361
    Read More
  13. 이름 마지막 한자리 별표 처리

    Date2019.12.13 Views326
    Read More
  14. 글 작성시 랜덤형 자동 댓글로 인사 멘트남기기

    Date2019.12.13 Views323
    Read More
  15. jQuery 요소(elements) 미디어 컨버팅 플러그인

    Date2019.12.13 Views320
    Read More
  16. 카운트다운 스크립트

    Date2019.12.13 Views317
    Read More
  17. 그누보드 카카오톡 로그인 V2 플러그인

    Date2021.03.24 Views289
    Read More
  18. style 수정시 서버에서 로딩되게 하기

    Date2019.12.13 Views255
    Read More
  19. 그누보드 이력서 스킨

    Date2021.03.24 Views151
    Read More
  20. 회원 등급(권한)에 따라서 다른 메시지 보이기

    Date2021.03.24 Views146
    Read More
Board Pagination Prev 1 2 3 4 Next
/ 4

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved