Fyne GoLang GUI Course IMAGE – Tutorial 8

Class 8 fyne GoLang GUI IMAGE

Images are very important part of any GUI design.

Fyne has a great support for images.

 

package main
// import fyne
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
)
func main() {
// New app
a := app.New()
// New Window and Title
w := a.NewWindow("Image in Fyne")
// resize window
w.Resize(fyne.NewSize(400, 400))
// Now Image widget
img := canvas.NewImageFromFile("c:/cartoon/health.jpg")
// setup content to show
w.SetContent(img)
// show and run
w.ShowAndRun()
}
Download Code

 

Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: