Click here to Skip to main content
15,889,403 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Opening word/pdf document in another window Pin
Blikkies29-Feb-16 23:01
professionalBlikkies29-Feb-16 23:01 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:06
indian1431-Mar-16 6:06 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:08
indian1431-Mar-16 6:08 
GeneralRe: Opening word/pdf document in another window Pin
indian1431-Mar-16 6:22
indian1431-Mar-16 6:22 
GeneralRe: Opening word/pdf document in another window Pin
Blikkies1-Mar-16 19:48
professionalBlikkies1-Mar-16 19:48 
GeneralRe: Opening word/pdf document in another window Pin
indian1432-Mar-16 15:18
indian1432-Mar-16 15:18 
AnswerRe: Opening word/pdf document in another window Pin
Blikkies29-Feb-16 22:09
professionalBlikkies29-Feb-16 22:09 
QuestionResizing Images, from Bytes[] back to bytes[] Pin
jkirkerx29-Feb-16 10:47
professionaljkirkerx29-Feb-16 10:47 
So I'm writing a new function to resize images for my MVC App.
This time, instead of reading the disk drive, and writing back, I thought I would just take the upload file stream as bytes and pump into this function.

So the way I was doing it before, was to
Read the Image,
Create a Bitmap Canvas
Create a Graphics resized with the Image
Write the Image to the Bitmap.
Save As File

So I'm down to the last step, save as something so I can save as bytes. Before I just wrote to the disk drive, but now I want to stuff it back into the database.

Am I going about this all wrong?

This is an example off the top of my head, it's been condensed to show what I'm doing.
public static byte[] resise(byte[] pBytes)
{
   MemoryStream ms_in = new MemoryStream(pBytes);
   Image requestObj = Image.FromStream(ms_in);

   Image bitmapObj = new Bitmap(t_Width, t_Height, PixelFormat.Format24bppRgb);

   Graphics graphicObj = Graphics.FromImage(bitmapObj);
   graphicObj.DrawImage(bitmapObj, xWidth, xHeight, t_Width, t_Height);

   // I can't figure this part out, how to save a Memory Stream, so I can go byte[]
   graphicObj.Save(ms_out);

   return ms_out.ToArray();

}

AnswerRe: Resizing Images, from Bytes[] back to bytes[] [I think its solved] Pin
jkirkerx29-Feb-16 11:45
professionaljkirkerx29-Feb-16 11:45 
General[Now it works], but needs advice on disposing Pin
jkirkerx29-Feb-16 12:51
professionaljkirkerx29-Feb-16 12:51 
QuestionAn Ajax Control is working on local machine not working on Server when deployed Pin
indian14327-Feb-16 14:32
indian14327-Feb-16 14:32 
AnswerRe: An Ajax Control is working on local machine not working on Server when deployed Pin
Nathan Minier29-Feb-16 1:36
professionalNathan Minier29-Feb-16 1:36 
GeneralRe: An Ajax Control is working on local machine not working on Server when deployed Pin
indian14329-Feb-16 11:10
indian14329-Feb-16 11:10 
QuestionASP.Net Pin
Member 1235142825-Feb-16 3:05
Member 1235142825-Feb-16 3:05 
AnswerRe: ASP.Net Pin
ZurdoDev25-Feb-16 4:09
professionalZurdoDev25-Feb-16 4:09 
AnswerRe: ASP.Net Pin
F-ES Sitecore25-Feb-16 21:52
professionalF-ES Sitecore25-Feb-16 21:52 
AnswerRe: ASP.Net Pin
Nathan Minier26-Feb-16 1:29
professionalNathan Minier26-Feb-16 1:29 
AnswerRe: ASP.Net Pin
Manas_Kumar26-Feb-16 7:17
professionalManas_Kumar26-Feb-16 7:17 
AnswerRe: ASP.Net Pin
aarif moh shaikh26-Feb-16 21:00
professionalaarif moh shaikh26-Feb-16 21:00 
QuestionPass ViewModel to view twice Pin
Member 1204569224-Feb-16 23:29
Member 1204569224-Feb-16 23:29 
AnswerRe: Pass ViewModel to view twice Pin
Nathan Minier25-Feb-16 1:53
professionalNathan Minier25-Feb-16 1:53 
QuestionGet file size from File Upload from IE and Chrome Pin
indian14324-Feb-16 15:49
indian14324-Feb-16 15:49 
AnswerRe: Get file size from File Upload from IE and Chrome Pin
F-ES Sitecore25-Feb-16 0:46
professionalF-ES Sitecore25-Feb-16 0:46 
QuestionSet the file upload value Pin
indian14324-Feb-16 11:24
indian14324-Feb-16 11:24 
AnswerRe: Set the file upload value Pin
Richard Deeming25-Feb-16 2:21
mveRichard Deeming25-Feb-16 2:21 

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.