?
Solved

bring graphics file into project

Posted on 1998-08-01
6
Medium Priority
?
161 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
In addition to being a great web-based presentation tool, Prezi also makes it easy to save your presentation as a PDF to share with others as well. Learn how in this tutorial. Select the share icon from the top menu in your Prezi editor: Select "D…
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

752 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