Click here to Skip to main content
6,596,602 members and growing! (18,979 online)
Email Password   helpLost your password?
Multimedia » General Graphics » Graphics     Intermediate

Converting image files to OTA file format (Mobile Picture Message)

By Alireza Naghizadeh

A simple code for converting image files to OTA file format (Mobile Picture Message).
C#, VC7.1.NET 1.1, WinXPVS.NET2003, Dev
Posted:8 Jul 2005
Views:78,643
Bookmarked:17 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
19 votes for this article.
Popularity: 4.70 Rating: 3.68 out of 5
2 votes, 10.5%
1

2

3
2 votes, 10.5%
4
15 votes, 78.9%
5

Introduction

I searched the internet for a program to convert the image files to the OTA file format, but there was none!!! So, I began researching for OTA file format details... finally, I wrote a program with C# to do this...

The source code and binary files are ready for download...

The main logic of this program is an algorithm for converting images. Mobile picture messages (OTA or OTB files) have a standard size: 72x28. First of all we must create a file (*.ota) and then write 4 standard bytes into it.

byte0 -> 0000 0000 (0)
byte1 -> 0100 1000 (72)
byte2 -> 0001 1100 (28)
byte3 -> 0000 0001 (1)

Now read image, pixel by pixel, from left to right and top to bottom, every 8 pixel makes a byte for writing to the file:

black pixels = 0
Other pixels = 1

An image with size 72x28:

has 72*28 = 2016 (bits)
every 8 bits = 1 byte => 2016 / 8 = 252
and 252(bytes) + 4(standard bytes) = 256 bytes

Finally, the file size is 256 bytes.

Download and read my source code to see this program working...

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Alireza Naghizadeh


Member
Alireza Naghizadeh
Occupation: Software Developer (Senior)
Location: Iran, Islamic Republic Of Iran, Islamic Republic Of

Other popular General Graphics articles:

  • A flexible charting library for .NET
    Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
  • CxImage
    CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
  • 3D Pie Chart
    A class library for drawing 3D pie charts.
  • Barcode Image Generation Library
    This library was designed to give an easy class for developers to use when they need to generate barcode images from a string of data.
  • ImageStone
    An article on a library for image manipulation.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 31 (Total in Forum: 31) (Refresh)FirstPrevNext
Generalwant a program in java to convert .jpg image into .ota format Pinmembershoaib_bagwan23:50 8 Sep '09  
Generalhi, Pinmemberprashant.patel31@gmail.com3:22 13 Apr '09  
GeneralRe: hi, Pinmembermusyab22:10 17 Apr '09  
GeneralHello Sir Pinmemberoviyaa19:03 16 Feb '09  
QuestionHow to send pic msgs (.ota) By Nokia E51 ? Pinmemberundead_fred3:45 11 Nov '08  
AnswerRe: How to send pic msgs (.ota) By Nokia E51 ? PinmemberAlireza Naghizadeh5:18 11 Nov '08  
GeneralTrouble with creating picture msg with my n70 PinmemberNikhil Dhotre7:44 15 Jul '08  
GeneralRegarding OTA PinmemberMuthuganesh2:44 12 Jul '08  
GeneralSending OTA file via SMPP protocol to NOKIA SMSC PinmemberIftee3:51 17 Jan '08  
GeneralAbout OTA file PinmemberTa Hoang Van15:58 9 Jan '08  
GeneralRe: About OTA file Pinmembervenki_pandi23:57 3 Feb '08  
GeneralNeed more idea Pinmembertykea_khy17:38 11 Dec '07  
GeneralSend Picture SMS as 1 SMS ( instead of conventional 3 SMS) PinmemberNight Safari23:33 3 Nov '07  
GeneralRe: Send Picture SMS as 1 SMS ( instead of conventional 3 SMS) Pinmemberstyle of worlds22:12 19 Jan '08  
GeneralFor this .OTAfile i have to instal any software in my mobile? PinmemberNarendra Mahalik2:56 24 Aug '07  
GeneralRe: For this .OTAfile i have to instal any software in my mobile? PinmemberAlireza Naghizadeh5:48 9 Sep '07  
Generalhow to send image ? PinmemberShakeel Mumtaz19:58 10 Jun '07  
GeneralRe: how to send image ? Pinmemberadnaneco20:13 18 Apr '09  
GeneralRe: how to send image ? PinmemberShakeel Mumtaz20:47 19 Apr '09  
GeneralRe: how to send image ? Pinmemberadnaneco3:54 20 Apr '09  
GeneralPicture message Pinmemberteznin2:14 5 Jan '07  
AnswerRe: Picture message PinmemberAlireza Naghizadeh19:26 6 Jan '07  
GeneralAbout This Program Pinmemberpouriia11:03 28 Mar '06  
GeneralWant Details abt OTA file format Pinmemberimran_3jan20:14 15 Mar '06  
GeneralRe: Want Details abt OTA file format [modified] Pinmemberbasudekrishna20:37 28 May '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 8 Jul 2005
Editor: Smitha Vijayan
Copyright 2005 by Alireza Naghizadeh
Everything else Copyright © CodeProject, 1999-2009
Web09 | Advertise on the Code Project