Right now i am using the method where i put the picture in a picbox, then save it as a .bmp then use SystemParametersInfo function to set the picture.
I do not like this because of one main reason: it takes huge amount of ram for a simple program such as this.

If anyone could help me out with a simpler/less ram consuming way to do this, it will be much appreciated. ;)

Recommended Answers

All 4 Replies

Background for what? Desktop or Application form?
Anyway you can dispose the object once you don't need it.

Try this:

Imports System.Drawing

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.BackgroundImageLayout = ImageLayout.Stretch
        Me.BackgroundImage = Image.FromFile("C:\Graphics\tree1.jpg")
    End Sub
End Class

Desktop background not the application background

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.