Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2007
    Posts
    682
    Thanks
    319
    Thanked 1 Time in 1 Post

    Rotating image problem

    I seem to have an issue with rotating an image. Here is the error (I'm guessing i'm saving this as the wrong file type):

    error
    Code:
    c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\vbc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\assembly\GAC_64\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_sddc93zi.dll" /debug- /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls  "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_sddc93zi.0.vb" "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_sddc93zi.1.vb"
    
    
    Microsoft (R) Visual Basic Compiler version 8.0.50727.5420
    for Microsoft (R) .NET Framework version 2.0.50727.5466
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_sddc93zi.0.vb(113) : error BC30429: 'End Sub' must be preceded by a matching 'Sub'.
    
            End Sub
            ~~~~~~~
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(2) : error BC30002: Type 'Bitmap' is not defined.
    
    Dim bitmap1 As Bitmap
                   ~~~~~~
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(4) : error BC30289: Statement cannot appear within a method body. End of method assumed.
    
    Private Sub InitializeBitmap()
    ~~~~~~~~~~~                   
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(6) : error BC30451: Name 'bitmap1' is not declared.
    
            bitmap1 = CType(Bitmap.FromFile("C:\inetpub\wwwroot\nightclub_photography\" _
            ~~~~~~~                                                                      
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(6) : error BC30451: Name 'Bitmap' is not declared.
    
            bitmap1 = CType(Bitmap.FromFile("C:\inetpub\wwwroot\nightclub_photography\" _
                            ~~~~~~                                                       
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(7) : error BC30002: Type 'Bitmap' is not defined.
    
                & "data\images\08072013\1\IMG_1145.JPG"), Bitmap)
                                                          ~~~~~~ 
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(8) : error BC30451: Name 'PictureBox1' is not declared.
    
            PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
            ~~~~~~~~~~~                                       
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(8) : error BC30451: Name 'PictureBoxSizeMode' is not declared.
    
            PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
                                   ~~~~~~~~~~~~~~~~~~         
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(9) : error BC30451: Name 'PictureBox1' is not declared.
    
            PictureBox1.Image = bitmap1
            ~~~~~~~~~~~                
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(9) : error BC30451: Name 'bitmap1' is not declared.
    
            PictureBox1.Image = bitmap1
                                ~~~~~~~
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(11) : error BC30451: Name 'MessageBox' is not declared.
    
            MessageBox.Show("There was an error. Check the path to the bitmap.")
            ~~~~~~~~~~                                                          
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(18) : error BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
    
        ByVal e As System.EventArgs) Handles Button1.Click
                                             ~~~~~~~      
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(20) : error BC30451: Name 'bitmap1' is not declared.
    
        If bitmap1 Is Not Nothing Then
           ~~~~~~~                    
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(20) : error BC30020: 'Is' requires operands that have reference types, but this operand has the value type 'Integer'.
    
        If bitmap1 Is Not Nothing Then
                      ~~~~~~~~~~~     
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(21) : error BC30451: Name 'bitmap1' is not declared.
    
            bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY)
            ~~~~~~~                                          
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(21) : error BC30451: Name 'RotateFlipType' is not declared.
    
            bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY)
                               ~~~~~~~~~~~~~~                
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(22) : error BC30451: Name 'PictureBox1' is not declared.
    
            PictureBox1.Image = bitmap1
            ~~~~~~~~~~~                
    C:\inetpub\wwwroot\nightclub_photography\test.aspx(22) : error BC30451: Name 'bitmap1' is not declared.
    
            PictureBox1.Image = bitmap1
                                ~~~~~~~
    test.aspx
    Code:
    <%
    Dim bitmap1 As Bitmap
    
    Private Sub InitializeBitmap()
        Try
            bitmap1 = CType(Bitmap.FromFile("C:\inetpub\wwwroot\nightclub_photography\" _
                & "data\images\08072013\1\IMG_1145.JPG"), Bitmap)
            PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
            PictureBox1.Image = bitmap1
        Catch ex As System.IO.FileNotFoundException
            MessageBox.Show("There was an error. Check the path to the bitmap.")
        End Try 
    End Sub
    
    Private Sub Button1_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button1.Click
    
        If bitmap1 Is Not Nothing Then
            bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY)
            PictureBox1.Image = bitmap1
        End If 
    
    End Sub
    %>
    Last edited by martynball; 07-08-2013 at 02:00 PM.

  • #2
    Regular Coder
    Join Date
    Nov 2007
    Posts
    682
    Thanks
    319
    Thanked 1 Time in 1 Post
    Also, just allowed the .cs filetype in the IIS settings and now it's saying this when I try to load the .cs file in Chrome.

    Code:
    HTTP Error 404.3 - Not Found
    The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,216
    Thanks
    75
    Thanked 4,344 Times in 4,310 Posts
    (1) Clearly, you forgot to include the graphics library in your code. Bitmap isn't defined anywhere, so of course it can't be used.

    (2) ".cs"??? What does that have to do with anything? ".cs" would be the extension for C# *source code*. You are coding in VB.NET, not C#. And in any case, the correct extension for any ASP.NET page is ".aspx". Yes, you can have ".cs" and ".vb" files in your project, but you can't serve those up to a web server.

    Are you not using Visual Studio to build your code? At least Visual Web Developer Express (the free version)? IF not, you need to.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    martynball (07-11-2013)

  • #4
    Regular Coder
    Join Date
    Nov 2007
    Posts
    682
    Thanks
    319
    Thanked 1 Time in 1 Post
    I'm only using ASP.NET to rotate the images. The rest is being coded in Dreamweaver as it's all HTML, CSS, JavaScript and ASP.

    I really have no clue how to go about using ASP.NET to rotate a picture, could you give me a step by step guide as I have looked around and can't really find anything.

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,216
    Thanks
    75
    Thanked 4,344 Times in 4,310 Posts
    Sorry, I've never use ASP.NET's graphics capabilities.

    Since ASP.NET on this site is an orphan, I'd suggest taking your question to some ASP.NET-centric forum. You might even try the forums at www.asp.net
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    martynball (07-11-2013)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •