473,503 Members | 3,866 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading binary files in C

saranjegan
51 New Member
hi dudes,

am in need to read and display a binary file..
shall i fallow this procedure
open the file using fopen and read the datas using fread but how can i display the file is it possible ?

let the environment be Visual C++
binary file be an image (bmp)

am in need of the procedural steps
let me try..thanks for your time
Mar 2 '07 #1
6 3391
horace1
1,510 Recognized Expert Top Contributor
hi dudes,

am in need to read and display a binary file..
shall i fallow this procedure
open the file using fopen and read the datas using fread but how can i display the file is it possible ?

let the environment be Visual C++
binary file be an image (bmp)

am in need of the procedural steps
let me try..thanks for your time
when you read the BMP image you can check the format is correct by printning inormation in the header etc
http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html

or you could display usinga suitable library function
Mar 2 '07 #2
saranjegan
51 New Member
when you read the BMP image you can check the format is correct by printning inormation in the header etc
http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html

or you could display usinga suitable library function

thanks for your link it helps me in reading the both file header and bitmap info header and printed the values too..it works out correctly but how can i display the image now
Mar 2 '07 #3
horace1
1,510 Recognized Expert Top Contributor
thanks for your link it helps me in reading the both file header and bitmap info header and printed the values too..it works out correctly but how can i display the image now
what compiler/operating system are you using? have a look thru the help system to see if there is a suitable library function
Mar 2 '07 #4
saranjegan
51 New Member
what compiler/operating system are you using? have a look thru the help system to see if there is a suitable library function

am using Visual C++ in Windows OS

i will try through help..let me know the functions if you know it...thanks for your time
Mar 2 '07 #5
horace1
1,510 Recognized Expert Top Contributor
am using Visual C++ in Windows OS

i will try through help..let me know the functions if you know it...thanks for your time
I don't use VC but I think you would use the LoadImage API
http://support.microsoft.com/kb/q158898/
Mar 2 '07 #6
saranjegan
51 New Member
I don't use VC but I think you would use the LoadImage API
http://support.microsoft.com/kb/q158898/
oh thanks dude..i finished displaying..your guidance helped a lot..thanks for your time will catch u soon with some other problems...
Mar 3 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
8884
by: christos panagiotou | last post by:
hi all I am trying to open some .raw files that represent images (256x256, 8 bit per pixel, no header) in a c++ program I cannot copy paste the module here as it uses a method from the VTK...
3
2804
by: Olivier Maurice | last post by:
Hi all, I suppose some of you know the program Redmon (type redmon in google, first result). This neat little tool allows to hook up any functionality to a printer by putting the file printed...
7
4203
by: laclac01 | last post by:
So I am converting some matlab code to C++. I am stuck at one part of the code. The matlab code uses fread() to read in to a vector a file. It's a binary file. The vector is made up of floats,...
50
4879
by: Michael Mair | last post by:
Cheerio, I would appreciate opinions on the following: Given the task to read a _complete_ text file into a string: What is the "best" way to do it? Handling the buffer is not the problem...
5
6428
by: rnorthedge | last post by:
I am working on a code library which needs to read in the data from large binary files. The files hold int, double and string data. This is the code for reading in the strings: protected...
7
6032
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should...
2
1881
by: amfr | last post by:
On windows, is there anything special I have to do to read a binary file correctly?
30
4535
by: siliconwafer | last post by:
Hi All, I want to know tht how can one Stop reading a file in C (e.g a Hex file)with no 'EOF'?
2
3234
by: nnimod | last post by:
Hi. I'm having trouble reading some unicode files. Basically, I have to parse certain files. Some of those files are being input in Japanese, Chinese etc. The easiest way, I figured, to distinguish...
6
5243
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
0
7207
marktang
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,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7012
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...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.