Solved

bring graphics file into project

Posted on 1998-08-01
6
156 Views
Last Modified: 2013-11-19
i am using symantec visual cafe
i want to bring a graphics file (bmp, jpg, etc.) into the project (much like one would add a resource to Visual C++)

how is this done?
0
Comment
Question by:jdaues
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:aziz061097
ID: 1230374
In the paint method of the Applet write the following code. where MyImage.jpg exists in the same directory where the applet is launched. You can even specify a path if the image file exists in other directory by getImage("\\Mydirectory\\MyImage.jpg");

Image img = getToolkit().getImage("MyImage.jpg");
g.drawImage(img, 0, 0, 615, 430, this);

0
 

Author Comment

by:jdaues
ID: 1230375
ummm...i guess i wasn't clear enough in my question.. your code is good, and in fact looks a lot like what i have already written.  what i wanted was a way to include the graphics file in my project, as opposed to the file being a separate piece.


0
 
LVL 3

Accepted Solution

by:
sailwind earned 50 total points
ID: 1230376
For me, I use the insert to add the image files to my project.
In Cafe, go to:
Insert -> files into project
choose files of type "net files", then select all the files you want
to include in your project and click on add.

- Tony

0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:jdaues
ID: 1230377
that's closer...i want to be able to refer to the bitmap within my project as a resource,
not a file.  is that possible?
0
 
LVL 3

Expert Comment

by:sailwind
ID: 1230378

First of all, can you clarify what's the difference between using the bitmap
as a resource and a file? Do you mean you want to access the bitmap when
you compile but not when you generate the final archive? What would the
advantage be to referring the bitmap as a resource as opposed to a file?
I looked around in the help file but didn't see any specifications for adding a
resource, only individual files.

0
 

Author Comment

by:jdaues
ID: 1230379
>can you clarify what's the difference between using the bitmap as a resource and a file
its something i am accustomed to doing in Visual C++, but apparently not possible in Visual Cafe.  its just a convenience of having the graphic in the project, as opposed to externally.

>I looked around in the help file but didn't see any specifications for adding a
>resource, only individual files.
i didn't either, but i just started using Visual Cafe last weekend, so i thought i would ask

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Add visuals to your Prezi to keep your audience engaged. Learn how to embed images, edit them, and more in this video micro tutorial. Select "Insert" from the top menu in your Prezi editor: Select "Image": A toolbar will pop in from the right …
Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…

785 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