mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
transfer image data
This commit is contained in:
parent
74be9b9911
commit
42a5efd09d
3 changed files with 322 additions and 35 deletions
|
|
@ -6,9 +6,11 @@
|
|||
|
||||
;;; A very brief example of using the canvas control.
|
||||
(defun on-new-window (body)
|
||||
(debug-mode body)
|
||||
(setf (title (html-document body)) "Tutorial 10")
|
||||
(let* ((canvas (create-canvas body :width 600 :height 400))
|
||||
(cx (create-context2d canvas)))
|
||||
(cx (create-context2d canvas))
|
||||
dat)
|
||||
(set-border canvas :thin :solid :black)
|
||||
(setf (fill-style cx) :green)
|
||||
(fill-rect cx 10 10 150 100)
|
||||
|
|
@ -19,7 +21,13 @@
|
|||
(begin-path cx)
|
||||
(ellipse cx 200 200 50 7 0.78 0 6.29)
|
||||
(path-stroke cx)
|
||||
(path-fill cx)))
|
||||
(path-fill cx)
|
||||
(setf dat (get-image-data cx 100 100 10 10))
|
||||
(put-image-data cx dat 10 200)
|
||||
(let ((data (json-image-data dat)))
|
||||
(setf data (ppcre:regex-replace-all ":0" data ":255"))
|
||||
(setf (json-image-data dat) data))
|
||||
(put-image-data cx dat 30 200)))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue