Class 8 fyne GoLang GUI IMAGE

Images are very important part of any GUI design.

Fyne has a great support for images.

 

[sourcecode lang=”go” autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ gutter=”true” highlight=”1-3,6,9″ htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”false” title=”Source Code main.go”]

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()
}

[/sourcecode] [easy_media_download url=”http://blogvali.com/wp-content/uploads/fyne-golang-downloads/main8.go” text=”Download Code” color=”red_darker”]

Fyne GoLang GUI Course

 

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: