twgh / xcgui

炫彩界面库. Go GUI library. Golang bindings for XCGUI, Windows GUI library, DirectUI design idea.

Home Page:https://pkg.go.dev/github.com/twgh/xcgui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gif图片无法显示出来

wengooooo opened this issue · comments

package main

import (
	_ "embed"
	"github.com/twgh/xcgui/app"
	"github.com/twgh/xcgui/widget"
	"github.com/twgh/xcgui/window"
	"github.com/twgh/xcgui/xc"
	"github.com/twgh/xcgui/xcc"
)


//go:embed 2.gif
var img1 []byte

func main() {
	a := app.New(true)
	w := window.NewWindow(0, 0, 415, 296, "", 0, xcc.Window_Style_Default)

	// 加载图片从内存
	hImg := xc.XImage_LoadMemory(img1)

	shapePic := widget.NewShapeGif(8, 30, 400, 260, w.Handle)

	shapePic.SetImage(hImg)

	w.ShowWindow(xcc.SW_SHOW)
	a.Run()
	a.Exit()
}

commented

我这边把d2d关了就好了