How to compile project with images on fyne and golang?

PHPz
Release: 2024-02-09 08:57:09
forward
979 people have browsed it

如何在 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!

Related labels:
source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!