How do I reference images so the program will run on another computer?
Right now, I'm using this...
Dim myBitmap As New Bitmap(imagepath & "cat.jpg")
image1.Image = myBitmap
The problem is "imagepath" is a hardcoded directory path to where "cat.jpg" is stored on my hard disk. When I send the program to another computer, it of course, can't find the images.
Also, is there a way to imbed images in with the exe file?
5 1609 Disclaimer: I'm speaking from a VB6 perspective, don't know what version you're using.
Sure, just load the image into the picturebox or imagebox control at design time. It will be stored in the EXE, and won't need to be loaded froma separate file at run time.
Right, that would work, but I have picture boxes that I use to display different images depending on what is happening.
I'm working on a simple rock-paper-scissors game. I have a picture box that displays an image of what the player selects. So the image can be of a rock, or paper, or scissors.
Right, that would work, but I have picture boxes that I use to display different images depending on what is happening.
I'm working on a simple rock-paper-scissors game. I have a picture box that displays an image of what the player selects. So the image can be of a rock, or paper, or scissors.
Well, there are a number of ways you can handle that. Two fairly simple methods that come to mind are: - Have three different images, all hidden. Then just make the appropriate one visible.
- Have three invisible images, and one visible one where you copy the one you want to display. You can do that just by assigning Picture1.Picture = Picture2.Picture. (Or possibly the Image property, I always forget.)
Thank you for the help!
I hadn't thought about loading the images into picture boxes and turning off their visibility.
That seems to have fixed it.
Many thanks!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: dr_tyson |
last post by:
I am trying to embed images into a wxPython app (created using Boa
Constructor), but have not been able to do so. I know how to embed
plots, but images seem to be a problem. I've tried using code...
|
by: theo.bruening |
last post by:
Hello all.
I hope someone can help me here. I need to make a db on many pictures,
however, if I OLE them, the access database grows hugely. If I only
hyperlink them, I can't view them. is there...
|
by: chrisse_2 |
last post by:
Hi,
All the records in my database will contain at least one picture. At
the moment all the images are part of the database as ole objects
although the database is way to big and there is only...
|
by: Edward |
last post by:
I have been doing some research about embedding images in HTML using
the data URL src method of the format:
<img src="/-/data:image/gif;base64,<DATA>">
My question is, how does one generate...
|
by: MissMarie |
last post by:
I've been playing around with DIV tables in myspace to better learn how to rewrite my own code for my business site without having to pay someone to design it. I've tried embedding a slideshow into...
|
by: Ram Shriram |
last post by:
My C++ project takes 45-60 minutes for linking, with link.exe taking up 100%
of the CPU.
I am using:
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft Visual C++...
|
by: macap.usenet |
last post by:
Hello,
i am embedding System.Web.UI.WebResources in my C# Class via:
I use this resource with:
Page.Header.Controls.Add(new LiteralControl("<link href='"ExtJS.yui-
ext.css"'...
|
by: DevEng |
last post by:
Hi all,
I am new to Python and trying to embed it into a c/c++ application. I
started with examples from the documentation pages and go to the Pure
Embedding example...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |