Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

bring graphics file into project

Posted on 1998-08-01
6
Medium Priority
?
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

609 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