Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Is there some way to include an image with a compiled EXE? If not, is there any other way to create a form with a background image that can be distributed as exe only?
  • *Experts*
Posted

If you set the Form's background image property it will embed the image for you in the EXE. Otherwise, you can include a binary file in your project (a BMP for instance), change it's property to embedded resource, and "load" it at runtime to set as the Form's background.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • *Experts*
Posted
... and "load" it at runtime to set as the Form's background.

 

Accomplished via:

 

Me.BackGroundImage = Image.FromStream([Assembly].GetExecutingAssembly().GetManifestResourceStream("image filename goes here"))

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted
Thank you both. I am now moving in the right direction. I'm still not quite getting it, but I think that is because I still need to gain a better understanding of assemblies and embedded resources. I have no trouble doing this in Visual Studio, but I am trying to also learn to do everything in straight code in Notepad because I want to be able to fully grasp what is going on behind the scenes.
Posted
The easiest way to understand how the .NET framework is put together is to browse through the Object Browser. Visual Studio doesn't hide any of the source code from you, it just adds a little to save you the typing. It has to many advantages to ignore (intellisense and debugger just to name a couple).
Gamer extraordinaire. Programmer wannabe.
Posted

I know, but I feel that I have been learning faster since I began using this "basic" approach because it is forcing me to write all the form code myself rather than relying on the IDE. Eventually, I am going to switch back to using VS after I feel very comfortable with the code.

 

However, I also want to learn all about compiling and packaging inside and out without having to rely completely on VS or MSI. I am a rather competent VB6 programmer, but I never learned enough about deployment to be able to fix anything more serious than a basic "missing dll" kind of installation error. I want to avoid making that mistake with .NET. I guess I'll be checking out the Deployment Forum before this thread gets moved because I've strayed too far off topic! Thanks again.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...