The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> C Programming
|
Importing graphics with Borland 5 compiler
Discuss Importing graphics with Borland 5 compiler in the C Programming forum on Dev Shed. Importing graphics with Borland 5 compiler C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 14th, 2003, 11:34 AM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Importing graphics with Borland 5 compiler
Hello, all.
I am taking classes in C++, and am reaching the end of the year. However, the class does not cover graphics, and I basically taught myself that, through my prior knowledge of various other languages.
While I have gotten the hang of graphics quite easily, I was wondering if there was a quick and easy way to load an external image from the disk, through use of libraries or an included function.
On another topic, while using the Windows BGI library, is there any way to have the other output window open up, and just use the Windows BGI window? The other window has my project title as it's title, and all of the iostream functions are executed here. While using the DOS BGI library, iostream functions were done in the same window as the graphics.
All help is greatly appreciated.
SpacePirate
|

May 14th, 2003, 03:13 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
>> I was wondering if there was a quick and easy way to load an external image from the disk, through use of libraries or an included function
You can use getimage() to get an area of the screen and put it in an array. You could then write this array to disk. Later, when you want to display the image, you can read it from file into an array and then use putimage to transfer the image on to the screen.
|

May 15th, 2003, 11:27 AM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I don't believe we have done files quite yet, and so I don't know how to load from an external file...
Is there any way I can use the putimage() function with an already existing bitmap?
If anyone can just tell me the libraries to include, and the basics of what to do, I'm pretty sure I can figure out the rest for myself...
Thanks!
|

May 15th, 2003, 03:58 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
>> Is there any way I can use the putimage() function with an already existing bitmap?
Yes, provided it is in the correct format.
>> If anyone can just tell me the libraries to include,
putimage() is a function of the BGI library. Since it appears that you're already using the BGI library, you don't need to include anything else.
|

May 16th, 2003, 10:40 AM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
The format for putimage is putimage(int __left, int __top, const void far *__bitmap, int __op), as I'm sure you know. However, the bitmap points to a bitmap already in memory. How would you go about loading a bitmap saved to a disk into memory, so I can use it with the putimage operation?
Sorry for the lack of clarity.
|

May 16th, 2003, 01:29 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
>> How would you go about loading a bitmap saved to a disk into memory.
fread() or blockread(), I guess 
|

May 19th, 2003, 10:27 AM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Allrighty!
Thanks!
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|