Solved

Visual Studio 2005 (Tools for Office) Embed jpeg in Windows form

Posted on 2007-11-13
1
339 Views
Last Modified: 2013-11-26
Hi

Is there a way to embed a jpeg in a VS 2005 Windows form so that it is part of the project?

Thanks

Murray
0
Comment
Question by:murbro
1 Comment
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 20277987
You can certainly embed an image into a Project...and then access that image from a Form...not sure if that is what you are asking for?...

Click on Project --> Add Existing Item and add your image.
Now select your image in the "Solution Explorer" window.
Down below in the "Properties" window, change the "Build Action" property from "Content" to "Embedded Resource".

Then even use code like this to load the image at run-time:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        PictureBox1.Image = New Bitmap(Me.GetType, "yourImageName.jpg")
    End Sub

End Class

Of course, you replace "yourImageName.jpg" with whatever the name of your embedded image is.

*** Note that this is one of the rare occasions where VB.Net IS actually case-sensitive. ***
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question