My Disk is BAD
-
That there is the best use of emoticons (especialle the badger) and free time ive seen on these forums..But then ofcourse, i dont visit the soapbox...
:badger:
Well I'm actually searching the web high and low for code that would allow you to pull an image from a database convert it to a byte[] array and stream it into an image control in asp .net and it would appear that my fictional laser would be easier to pull off as there's not a single example out there that explains a way to do this. So I figured to pass away time wilst I restarted firefox by expressing my own boredom and frustration of the moment...:sigh:
-
Well I'm actually searching the web high and low for code that would allow you to pull an image from a database convert it to a byte[] array and stream it into an image control in asp .net and it would appear that my fictional laser would be easier to pull off as there's not a single example out there that explains a way to do this. So I figured to pass away time wilst I restarted firefox by expressing my own boredom and frustration of the moment...:sigh:
no need for excuses ;P and as to your problem, do you _have_ to stream it? if im understanding correctly, cant you just create an image object from the byte[] and then output that to the client? if nothing else, create a separate page that does that...and then reference it with an index of the item in the DB or something. all that page would do is just output the image(gotten from the byte[]) and set its(page's) output type(or whatever its called) to image(/jpeg or something else, cant remember).
:badger:
-
My stupid disk is BAD. Why the MBR!!! Why was it hit by a cosmic ray!!!
-------------------------- Eric I still need to learn C++! --------------------------
-
no need for excuses ;P and as to your problem, do you _have_ to stream it? if im understanding correctly, cant you just create an image object from the byte[] and then output that to the client? if nothing else, create a separate page that does that...and then reference it with an index of the item in the DB or something. all that page would do is just output the image(gotten from the byte[]) and set its(page's) output type(or whatever its called) to image(/jpeg or something else, cant remember).
:badger:
Yes, I can do that and I've seen that as an option but it sure seems like there should be a more elegant solution. I'd like to page the stream into memory and then build the image from the byte stream out of memory. It's looking like I'll have to use what you suggest or do something along the lines of RequestImage->WriteStreamToFile->DisplayImage.ImageURL(FilePath)->DeleteFile which is a lot more IO than I want and disk access is always a total annoyance at least they are 15,000 RPM SCSI drives but still... With all the *HYPE* in .Net and considering how *EASY* the same thing is in Winforms you'd think they would have take that tiny bit of effort to make it the same in ASP .Net. There are times where I really do wish I had the code to the framework...:suss: I'm going to pester the guys in the ASP.Net forum just to make sure I'm not overlooking something...
-
Yes, I can do that and I've seen that as an option but it sure seems like there should be a more elegant solution. I'd like to page the stream into memory and then build the image from the byte stream out of memory. It's looking like I'll have to use what you suggest or do something along the lines of RequestImage->WriteStreamToFile->DisplayImage.ImageURL(FilePath)->DeleteFile which is a lot more IO than I want and disk access is always a total annoyance at least they are 15,000 RPM SCSI drives but still... With all the *HYPE* in .Net and considering how *EASY* the same thing is in Winforms you'd think they would have take that tiny bit of effort to make it the same in ASP .Net. There are times where I really do wish I had the code to the framework...:suss: I'm going to pester the guys in the ASP.Net forum just to make sure I'm not overlooking something...
code-frog wrote:
There are times where I really do wish I had the code to the framework...
You could always learn ASM and find a disassembler you like..... And for the streaming thing, I remember I've spent a fair amount of time on trying to find that, although back in the days(heh, ok, not _THAT_ long ago) of .Net 1.0 and the only way I could get it to work is from a separate page. Ive actually tried the save-to-file-read-from-it-delete-it solution. was too slow and my HDD hated it. If you find something though, do share. i'm very interested in this, jsut for personal knowledge.
:badger:
-
My stupid disk is BAD. Why the MBR!!! Why was it hit by a cosmic ray!!!
-------------------------- Eric I still need to learn C++! --------------------------
-
Well I'm actually searching the web high and low for code that would allow you to pull an image from a database convert it to a byte[] array and stream it into an image control in asp .net and it would appear that my fictional laser would be easier to pull off as there's not a single example out there that explains a way to do this. So I figured to pass away time wilst I restarted firefox by expressing my own boredom and frustration of the moment...:sigh:
I'm fairly sure I've seen this done as an HttpHandler - .ashx file. Example: http://www.dotnetmaniac.com/ArticleViewer.aspx?Key={60bf8794-bb75-4c7b-b0fa-8a7e0a63540a}[^].
Stability. What an interesting concept. -- Chris Maunder
-
I'm fairly sure I've seen this done as an HttpHandler - .ashx file. Example: http://www.dotnetmaniac.com/ArticleViewer.aspx?Key={60bf8794-bb75-4c7b-b0fa-8a7e0a63540a}[^].
Stability. What an interesting concept. -- Chris Maunder
If I could rate you more than a 5, I would. I guess I gotta start learning things from books and not through self-experimentation. ASP.Net might be one of them, although i VERY much dislike all that is .Net. Ironically, we use C# at work(not a web app).
:badger:
-
My stupid disk is BAD. Why the MBR!!! Why was it hit by a cosmic ray!!!
-------------------------- Eric I still need to learn C++! --------------------------