Click here to Skip to main content
15,502,919 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Script function is not working. Pin
sashidhar6-Nov-09 19:59
sashidhar6-Nov-09 19:59 
GeneralRe: Script function is not working. Pin
bhavnvyas6-Nov-09 20:08
bhavnvyas6-Nov-09 20:08 
GeneralRe: Script function is not working. Pin
sashidhar6-Nov-09 20:06
sashidhar6-Nov-09 20:06 
QuestionSession is not working Pin
krishnaveer6-Nov-09 0:47
krishnaveer6-Nov-09 0:47 
AnswerRe: Session is not working Pin
bhavnvyas6-Nov-09 2:07
bhavnvyas6-Nov-09 2:07 
QuestionProblem with image upload in 2008 Pin
hemant.kaushal5-Nov-09 23:51
hemant.kaushal5-Nov-09 23:51 
AnswerRe: Problem with image upload in 2008 Pin
sashidhar6-Nov-09 0:09
sashidhar6-Nov-09 0:09 
GeneralRe: Problem with image upload in 2008 Pin
hemant.kaushal6-Nov-09 0:26
hemant.kaushal6-Nov-09 0:26 
I m trying to create thumbnail image of uploaded image

{
                          image = new byte[len];
                          updFIle.PostedFile.InputStream.Read(image, 0, len);



                          ImageUtility objImage = new ImageUtility();
                          timage = objImage.UpdateGalleryphoto(filemime, len, image, 100, 100);

                          filename = updFIle.FileName;
                          BL.clsAdmin obj = new BL.clsAdmin();
                          //DataTable dt = obj.uploadImage(Request.QueryString["prop"].ToString(), image, timage, txtCaption.Text, filename, filemime);
}


updateGallery photo is function which generates the thumbnail

public byte[] UpdateGalleryphoto(String strImageType, int len, byte[] thumbnail, int height,int width)
        {
            byte[] Thumbpic = null;
            try
            {
                int EH = 75; // Max height of thumbnail
                int EW = 100;//= 100; // Max width  of thumbnail
                Thumbpic = new byte[len];
                MemoryStream stream = new MemoryStream(thumbnail);
                Bitmap bmp = (Bitmap)System.Drawing.Image.FromStream(stream);
                int w = bmp.Width;
                int h = bmp.Height;
                bool bImage = false;
                // Adjust hegith or width  on basic of width or height whichever is greater on same ratio

                if (height >= h && width >= w)
                {
                    return thumbnail;
                }

                if (h >height)
                {
                    EW = (EH * w) / h;
                }
                else
                {
                    EH = (EW * h) / w;
                }  
                
                Thumbpic = ModifyImage(thumbnail, EW, EH, strImageType, bImage);
               

            }
            catch (Exception ex)
            {
                throw ex;
            }

            return Thumbpic;

        }



above code is working in 2005 but throwing exception in 2008 at line
Bitmap bmp = (Bitmap)System.Drawing.Image.FromStream(stream);

Questionhelp in making aa application in .net(C#) of soil prediction model Pin
shikhanirankari5-Nov-09 23:48
shikhanirankari5-Nov-09 23:48 
AnswerRe: help in making aa application in .net(C#) of soil prediction model Pin
Gamzun5-Nov-09 23:57
Gamzun5-Nov-09 23:57 
AnswerRe: help in making aa application in .net(C#) of soil prediction model Pin
sashidhar6-Nov-09 0:16
sashidhar6-Nov-09 0:16 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
shikhanirankari6-Nov-09 0:41
shikhanirankari6-Nov-09 0:41 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
sashidhar6-Nov-09 1:09
sashidhar6-Nov-09 1:09 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
shikhanirankari6-Nov-09 1:21
shikhanirankari6-Nov-09 1:21 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
sashidhar6-Nov-09 2:16
sashidhar6-Nov-09 2:16 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
Gamzun6-Nov-09 4:27
Gamzun6-Nov-09 4:27 
GeneralRe: help in making aa application in .net(C#) of soil prediction model [modified] Pin
sashidhar6-Nov-09 6:24
sashidhar6-Nov-09 6:24 
Questionexport to excel visible false......... Pin
bhavnvyas5-Nov-09 23:37
bhavnvyas5-Nov-09 23:37 
AnswerRe: export to excel visible false......... Pin
sashidhar6-Nov-09 0:02
sashidhar6-Nov-09 0:02 
GeneralRe: export to excel visible false......... Pin
bhavnvyas6-Nov-09 0:34
bhavnvyas6-Nov-09 0:34 
GeneralRe: export to excel visible false......... Pin
sashidhar6-Nov-09 0:53
sashidhar6-Nov-09 0:53 
GeneralRe: export to excel visible false......... Pin
bhavnvyas6-Nov-09 1:17
bhavnvyas6-Nov-09 1:17 
GeneralRe: export to excel visible false......... Pin
sashidhar6-Nov-09 1:20
sashidhar6-Nov-09 1:20 
QuestionInterop Excel Pin
mithun narayanan5-Nov-09 23:19
mithun narayanan5-Nov-09 23:19 
AnswerRe: Interop Excel Pin
sashidhar5-Nov-09 23:58
sashidhar5-Nov-09 23:58 

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.