Home >Backend Development >Golang >How to compile project with images on fyne and golang?

How to compile project with images on fyne and golang?

PHPz
PHPzforward
2024-02-09 08:57:091022browse

如何在 fyne 和 golang 上编译带有图像的项目?

php editor Banana will introduce to you how to compile projects with images on fyne and golang. fyne is an easy-to-use GUI toolkit for building cross-platform applications, while golang is a powerful programming language. Combining the two we can develop feature-rich applications with graphic effects. In this article, we will explore some methods and techniques for compiling projects with images to help you achieve your goals easily. Whether you are a newbie or an experienced developer, this article will provide you with helpful guidance and advice. let's start!

Question content

I have a project where I upload an image using the following function: "file.Load Resource From Path("resources/img/planets/mercury.png")", but when When I try to compile the project using: "fyne-cross windows -arch=*" and transfer the EXE file from the current directory, the pictures in my program do not show up

go build main.go, fyne-cross windows -arch=386 i don't know what i can do

Solution

The "resources" folder is only part of the source code. Fyne (like Go) applications are single binaries and are not distributed with assets. If you want to include similar projects, you should bundle them - "fyne bundle" or "go embed" will sort that for you.

The above is the detailed content of How to compile project with images on fyne and golang?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete