Click here to Skip to main content
15,437,015 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Script function is not working. Pin
sashidhar6-Nov-09 18:59
Membersashidhar6-Nov-09 18:59 
GeneralRe: Script function is not working. Pin
bhavnvyas6-Nov-09 19:08
Memberbhavnvyas6-Nov-09 19:08 
GeneralRe: Script function is not working. Pin
sashidhar6-Nov-09 19:06
Membersashidhar6-Nov-09 19:06 
QuestionSession is not working Pin
krishnaveer5-Nov-09 23:47
Memberkrishnaveer5-Nov-09 23:47 
AnswerRe: Session is not working Pin
bhavnvyas6-Nov-09 1:07
Memberbhavnvyas6-Nov-09 1:07 
QuestionProblem with image upload in 2008 Pin
hemant.kaushal5-Nov-09 22:51
Memberhemant.kaushal5-Nov-09 22:51 
AnswerRe: Problem with image upload in 2008 Pin
sashidhar5-Nov-09 23:09
Membersashidhar5-Nov-09 23:09 
GeneralRe: Problem with image upload in 2008 Pin
hemant.kaushal5-Nov-09 23:26
Memberhemant.kaushal5-Nov-09 23: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 22:48
Membershikhanirankari5-Nov-09 22:48 
AnswerRe: help in making aa application in .net(C#) of soil prediction model Pin
Gamzun5-Nov-09 22:57
MemberGamzun5-Nov-09 22:57 
AnswerRe: help in making aa application in .net(C#) of soil prediction model Pin
sashidhar5-Nov-09 23:16
Membersashidhar5-Nov-09 23:16 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
shikhanirankari5-Nov-09 23:41
Membershikhanirankari5-Nov-09 23:41 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
sashidhar6-Nov-09 0:09
Membersashidhar6-Nov-09 0:09 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
shikhanirankari6-Nov-09 0:21
Membershikhanirankari6-Nov-09 0:21 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
sashidhar6-Nov-09 1:16
Membersashidhar6-Nov-09 1:16 
GeneralRe: help in making aa application in .net(C#) of soil prediction model Pin
Gamzun6-Nov-09 3:27
MemberGamzun6-Nov-09 3:27 
GeneralRe: help in making aa application in .net(C#) of soil prediction model [modified] Pin
sashidhar6-Nov-09 5:24
Membersashidhar6-Nov-09 5:24 
Questionexport to excel visible false......... Pin
bhavnvyas5-Nov-09 22:37
Memberbhavnvyas5-Nov-09 22:37 
AnswerRe: export to excel visible false......... Pin
sashidhar5-Nov-09 23:02
Membersashidhar5-Nov-09 23:02 
GeneralRe: export to excel visible false......... Pin
bhavnvyas5-Nov-09 23:34
Memberbhavnvyas5-Nov-09 23:34 
GeneralRe: export to excel visible false......... Pin
sashidhar5-Nov-09 23:53
Membersashidhar5-Nov-09 23:53 
GeneralRe: export to excel visible false......... Pin
bhavnvyas6-Nov-09 0:17
Memberbhavnvyas6-Nov-09 0:17 
GeneralRe: export to excel visible false......... Pin
sashidhar6-Nov-09 0:20
Membersashidhar6-Nov-09 0:20 
QuestionInterop Excel Pin
mithun narayanan5-Nov-09 22:19
Membermithun narayanan5-Nov-09 22:19 
AnswerRe: Interop Excel Pin
sashidhar5-Nov-09 22:58
Membersashidhar5-Nov-09 22: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.