본문으로 바로가기

pix 0.6

category Tcl & Tk/확장 패키지 (Extension Package) 2025. 9. 8. 09:42

홈페이지: https://github.com/nico-robert/pix

 

Pixie는 Nim 언어로 작성된 기능이 풍부한 2D 그래픽 라이브러리이며, pix는 Tcl/Tk에서 사용가능하게 래핑한 확장 패키지입니다.

 

Tcl/Tk wrapper around Pixie, a full-featured 2D graphics library written in Nim.

package require pix

# Init 'context' with size + color.
set ctx [pix::ctx::new {200 200} "white"]

# Style first rectangle.
pix::ctx::fillStyle $ctx "rgb(0, 0, 255)" ; # blue color
pix::ctx::fillRect $ctx {10 10} {100 100}

# Style second rectangle.
pix::ctx::fillStyle $ctx "rgba(255, 0, 0, 0.5)" ; # red color with alpha 50%
pix::ctx::fillRect $ctx {50 50} {100 100}

# Save context in a image file (*.png|*.bmp|*.qoi|*.ppm)
pix::ctx::writeFile $ctx rectangle.png

# Or display in label by example :
set p [image create photo]
pix::drawSurface $ctx $p
label .l -image $p
pack .l

pix-0.6.zip
5.36MB

'Tcl & Tk > 확장 패키지 (Extension Package)' 카테고리의 다른 글

XOTcl 1.6.8  (0) 2025.09.05
TclOO 1.0.4  (0) 2025.09.05
tDOM 0.9.6  (0) 2025.09.02
Tclcsv 2.4.3  (0) 2025.09.02
Tablelist 7.7  (0) 2025.09.02