23 lines
291 B
Go
23 lines
291 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"embed"
|
||
|
|
||
|
"github.com/ying32/govcl/vcl"
|
||
|
)
|
||
|
|
||
|
//go:embed img/*
|
||
|
var images embed.FS
|
||
|
|
||
|
func getImageBitmap(path string) *vcl.TBitmap {
|
||
|
b, err := images.ReadFile(path)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
pic := vcl.NewPicture()
|
||
|
pic.LoadFromBytes(b)
|
||
|
|
||
|
return pic.Bitmap()
|
||
|
}
|