Click here to Skip to main content
15,921,884 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to diplay web page inside another web page window? Pin
Vasudevan Deepak Kumar28-Feb-07 14:38
Vasudevan Deepak Kumar28-Feb-07 14:38 
QuestionHow to retrieve non fixed-length records from a binary file Pin
htres28-Feb-07 9:20
htres28-Feb-07 9:20 
AnswerRe: How to retrieve non fixed-length records from a binary file Pin
Luc Pattyn28-Feb-07 10:14
sitebuilderLuc Pattyn28-Feb-07 10:14 
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
htres1-Mar-07 3:04
htres1-Mar-07 3:04 
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
Luc Pattyn1-Mar-07 7:07
sitebuilderLuc Pattyn1-Mar-07 7:07 
AnswerRe: How to retrieve non fixed-length records from a binary file Pin
htres5-Mar-07 4:48
htres5-Mar-07 4:48 
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
Luc Pattyn5-Mar-07 11:14
sitebuilderLuc Pattyn5-Mar-07 11:14 
GeneralRe: How to retrieve non fixed-length records from a binary file Pin
htres5-Mar-07 13:11
htres5-Mar-07 13:11 
Luc Pattyn wrote:
I would not fully trust the string.IndexOf part, since string operations
perform unpredictably on non-string data (such as JPEG images, which can
contain any bit pattern, that could be misinterpreted as Unicode characters).


You are right, I had a lot of trouble with string.IndexOf when I was trying to isolate just the jpeg by searching for small strings of 2-4 chars. But after a lot of testing using it to find the record delimiter, which is the same 16 byte string in every record, it works very reliably. Even though it is entirely possible for this particular 16 byte string to show up within the jpeg encoding, the odds are against it.

Luc Pattyn wrote:
htres wrote:
each record has a fixed 223 byte header

That's new info, makes things easier I guess.


Yeah it was a lot easier. That 223 byte header contained the fixed length fields that held the information about the image. I probably should have posted an example of the file format...but it would have been ugly since it is mostly binary.

Luc Pattyn wrote:
htres wrote:
wrote it to disk, named it .jpg, and tada, I had the jpeg image

As I mentioned earlier if you want the image I guess you can do it without
such file using Image.FromStream(); if you need the file, then it is the
way to go.


I haven't tried the Image.FromStream option yet, though I plan to eventually. Ultimately I'd like to populate a database with the picture and header data as well. But I'll leave that part for a new thread...

Wink | ;)

Thanks for the help!
AnswerRe: How to retrieve non fixed-length records from a binary file Pin
DavidAtAscent28-Feb-07 14:12
DavidAtAscent28-Feb-07 14:12 
QuestionHow to add new control instances with sprcified name from within a custom control at design time Pin
Galib Anwar28-Feb-07 9:08
Galib Anwar28-Feb-07 9:08 
QuestionRegistering a COM component to use in VB6 Pin
gus_br28-Feb-07 8:31
gus_br28-Feb-07 8:31 
AnswerRe: Registering a COM component to use in VB6 Pin
mike montagne28-Feb-07 8:43
mike montagne28-Feb-07 8:43 
AnswerRe: Registering a COM component to use in VB6 Pin
DavidAtAscent28-Feb-07 13:49
DavidAtAscent28-Feb-07 13:49 
QuestionDataGridView DataBinding problem Pin
royk12328-Feb-07 8:11
royk12328-Feb-07 8:11 
QuestionHow to Fix the Column Width? Pin
Khoramdin28-Feb-07 8:03
Khoramdin28-Feb-07 8:03 
AnswerRe: How to Fix the Column Width? Pin
Ed.Poore28-Feb-07 8:18
Ed.Poore28-Feb-07 8:18 
Questionc# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com28-Feb-07 7:52
jtamil2001@yahoo.com28-Feb-07 7:52 
AnswerRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz28-Feb-07 7:57
Stefan Troschuetz28-Feb-07 7:57 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com1-Mar-07 0:38
jtamil2001@yahoo.com1-Mar-07 0:38 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz1-Mar-07 0:57
Stefan Troschuetz1-Mar-07 0:57 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com1-Mar-07 4:35
jtamil2001@yahoo.com1-Mar-07 4:35 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz1-Mar-07 4:45
Stefan Troschuetz1-Mar-07 4:45 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com2-Mar-07 2:33
jtamil2001@yahoo.com2-Mar-07 2:33 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
Stefan Troschuetz2-Mar-07 3:01
Stefan Troschuetz2-Mar-07 3:01 
GeneralRe: c# installer - exception throws - space inbetween folder name Pin
jtamil2001@yahoo.com2-Mar-07 7:11
jtamil2001@yahoo.com2-Mar-07 7:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.