Click here to Skip to main content
15,885,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: problems creating setup for C# application Pin
Frank Kerrigan1-Mar-09 9:37
Frank Kerrigan1-Mar-09 9:37 
GeneralRe: problems creating setup for C# application Pin
laziale1-Mar-09 9:59
laziale1-Mar-09 9:59 
Questionvirtual node algorithm Pin
sunnyk861-Mar-09 7:43
sunnyk861-Mar-09 7:43 
AnswerRe: virtual node algorithm Pin
Alan N1-Mar-09 8:02
Alan N1-Mar-09 8:02 
GeneralRe: virtual node algorithm Pin
sunnyk861-Mar-09 8:36
sunnyk861-Mar-09 8:36 
Questiondelegate Pin
sheemap1-Mar-09 5:54
sheemap1-Mar-09 5:54 
AnswerRe: delegate Pin
Calin Tatar1-Mar-09 6:01
Calin Tatar1-Mar-09 6:01 
GeneralBest way to extract an image from a stream at a position other than 0? [modified] Pin
harold aptroot1-Mar-09 5:32
harold aptroot1-Mar-09 5:32 
The problem is, Image.FromStream likes to reset the position to 0 (somewhere in its scary native methods) and that's exactly what I do not want, since the image in question is simply not located there. Currently I work around this by copying a big part of the stream starting at the point where the image starts to a MemoryStream, but it's taking quite a while and it seems like it shouldn't be needed. This means I have to scan for a pattern that "looks like the header of the next image" which may not always work (what if the data itself contains sometime that looks like a header but isn't?).
I'm sure there is a better way to do this.
I've tried creating a stream that does not support seeking, but Image.FromStream hates that and copies the stream over to a MemoryStream itself so it's effectively equivalent to the "manual" way. Silently ignoring seeks and assignments to Position didn't exactly work so I guess it somehow needs them - would it be ok accept seeks and positions as long as they don't move the position to before a certain value? That sounds a lot like a hack to me - I hope there is a better way.



Last modified: 11mins after originally posted --



GeneralRe: Best way to extract an image from a stream at a position other than 0? Pin
Alan N1-Mar-09 8:22
Alan N1-Mar-09 8:22 
GeneralRe: Best way to extract an image from a stream at a position other than 0? Pin
harold aptroot1-Mar-09 9:29
harold aptroot1-Mar-09 9:29 
GeneralRe: Best way to extract an image from a stream at a position other than 0? Pin
Anthony Mushrow1-Mar-09 8:24
professionalAnthony Mushrow1-Mar-09 8:24 
GeneralRe: Best way to extract an image from a stream at a position other than 0? Pin
harold aptroot1-Mar-09 9:29
harold aptroot1-Mar-09 9:29 
GeneralRe: Best way to extract an image from a stream at a position other than 0? Pin
Anthony Mushrow1-Mar-09 9:42
professionalAnthony Mushrow1-Mar-09 9:42 
GeneralRe: Best way to extract an image from a stream at a position other than 0? Pin
harold aptroot1-Mar-09 10:04
harold aptroot1-Mar-09 10:04 
Questionreduce blocking queue of Tcp socket c# Pin
abdul jalil1-Mar-09 3:37
abdul jalil1-Mar-09 3:37 
Questionconnect to sql server 2000 on another computer Pin
H.R1-Mar-09 2:51
H.R1-Mar-09 2:51 
AnswerRe: connect to sql server 2000 on another computer Pin
Douglas Troy1-Mar-09 6:56
Douglas Troy1-Mar-09 6:56 
Questionhow can i increament an integer variable by one when the application has two threads running? Pin
shanjaf1-Mar-09 1:40
shanjaf1-Mar-09 1:40 
AnswerRe: how can i increament an integer variable by one when the application has two threads running? Pin
Calin Tatar1-Mar-09 1:59
Calin Tatar1-Mar-09 1:59 
AnswerRe: how can i increament an integer variable by one when the application has two threads running? Pin
waqarmushtaq845-Mar-09 2:41
waqarmushtaq845-Mar-09 2:41 
QuestionOpen Form Incide another Form Pin
CristianConrads1-Mar-09 0:58
CristianConrads1-Mar-09 0:58 
AnswerRe: Open Form Incide another Form Pin
Henry Minute1-Mar-09 1:19
Henry Minute1-Mar-09 1:19 
GeneralRe: Open Form Incide another Form Pin
Trooks1-Mar-09 3:08
Trooks1-Mar-09 3:08 
GeneralRe: Open Form Incide another Form Pin
CristianConrads1-Mar-09 3:22
CristianConrads1-Mar-09 3:22 
GeneralRe: Open Form Incide another Form Pin
Henry Minute1-Mar-09 7:16
Henry Minute1-Mar-09 7:16 

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.