Solved

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

Posted on 2007-11-13
1
334 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now