이미지에 워터마크 추가하기 > 그누보드5 팁자료실

그누보드5 팁자료실

이미지에 워터마크 추가하기 정보

이미지에 워터마크 추가하기

본문

<?php

    // Load the stamp and the photo to apply the watermark to

    $stamp = imagecreatefrompng('text.png');

    $im = imagecreatefrompng('original.png');

    

    // Set the margins for the stamp and get the height/width of the stamp image

    $marge_right = 10;

    $marge_bottom = 10;

    $sx = imagesx($stamp);

    $sy = imagesy($stamp);

    

    // Copy the stamp image onto our photo using the margin offsets and the photo 

    // width to calculate positioning of the stamp. 

    imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));

    

    // Output and free memory

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

    imagepng($im);

    imagedestroy($im);

?>

 

    $stamp = imagecreatefrompng('text.png');

    $im = imagecreatefrompng('original.png');

오리지날 이미지와 text.png 이미지가 겹쳐져 워터마크 기능이 됩니다.

 

 

 

추천
5

댓글 4개

팁을 알려주시려면 적용방법등 자세히 알려주시면 감사하겠습니다~
저러케 만 적어주시면..........
초보분들에게는 적용에 무리가 있다고 보여집니다....
전체 2,427 |RSS
그누보드5 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT