如何将图像(例如 png)添加到frame% 对象上?
#lang racket
(define my-frame (new frame%))
;want to add an image to my-frame
最佳答案
使用a canvas .
(define my-frame (new frame%
[label "Example"]
[width 300]
[height 300]))
(new canvas%
[parent my-frame]
[paint-callback
(λ (canvas dc)
(send dc draw-bitmap (read-bitmap "/path/to/image.png") 0 0))])
(send my-frame show #t)
关于user-interface - 如何在 Racket GUI 工具包中的框架上添加图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68380048/