File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Code for binary file to bitmap file conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Code for binary file to bitmap file conversion " Watch "Code for binary file to bitmap file conversion " New topic
Author

Code for binary file to bitmap file conversion

swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
Hi,

I have a file that have .bin extension and i need to convert it into .bmp code.
Can any body provide me the exact code for this type of conversion.
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
.bin files are generally CD/DVD images. Is that the kind of file you have?
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
Actually right now i do not have binary file.
If we assume that it is a video or image then provide me solution according to that.
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
Without knowing the file type, there is no way to do any conversion. I still don't understand what you mean convert to a bitmap file. Are there images like .jpg, .png in the .bin file and you need to convert them to bmp format? If it is a video file how are you going to convert it a bmp file? Do you mean to extract individual frames and save them as bmp?
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
I have a 10-15 .bin files that are the frames generated from a video.
Now i need to write down a code that will change that files into .bmp files.
Please help me soon.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
There are many ways to store an image in a file. As Satish mentions, without knowing which format the images are in, we can't give advice on how to convert them.


Ping & DNS - my free Android networking tools app
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
I dont know about the header-footer of image.
Please provide me any sample code for .bin to .bmp conversion.
I am using AIR technology that is responsible to create frames and store them into .bin file.
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
Can any body convert this c# code into java.
(This code is converting .bin file into .bmp)

swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
format -- PixelFormat.Format32bppArgb
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3429
    
  12
Originally posted by swati mittal:
Can any body convert this c# code into java.


NotACodeMill
Why don't you have a go and then let us know if you get stuck anywhere.


Joanne
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
Originally posted by swati mittal:
Can any body convert this c# code into java.
I am willing to convert that bit to Java. It readsYou ought to be able to convert the rest of the code without a lot of effort; remember C# and Java are very similar. You will have to alter some of the names of classes, lose the "using" keyword, and in Java Thread.sleep() declares a checked Exception, but the whole job ought not to be too difficult.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
Originally posted by Campbell Ritchie:
I am willing to convert that bit to Java. It reads[CODE]


Sorry, I made a mistake. It should read data.length not data.Length.
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
C# code is using class "BitmapData". But java does not contain any class which can work like BitmapData.
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
At last I am able to convert my .bin file into .bmp file.
This is the code --

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
Well done. ( ) C# code really looks like Java code, doesn't it.
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
yes it looks like a java.
But I faced lot of problems because some classes are available in C# but not in java.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code for binary file to bitmap file conversion
 
Similar Threads
Hardcoding field names
Grabbing File names only
How to convert simple Java Code into amazon's AMI
html to pdf
How to replace '\' character by '/' one????