Results 1 to 21 of 21

Thread: [RESOLVED] A Generic Error Occurred In GDI+

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Resolved [RESOLVED] A Generic Error Occurred In GDI+

    Hi

    Hope you all are doing great.


    I am trying to do a comparison between to image files for some specific Pixl values. I have been successful in it however it runs in the first go ( first go: -that is uploading the image for the first time) and when i upload another image and try to run it again my code gives me an error " A Generic Error Occurred In GDI+".

    below mention is my code.


    Code:
    Option Compare Binary
    Option Explicit On
    Option Infer On
    Option Strict On
    Imports System
    Imports System.Collections.Generic
    Imports System.Drawing
    Imports System.IO
    
    Public Class Form13
        Dim add As String
        Dim BitmapO As Bitmap
        Public Structure PixelStr
            Public ColorO As Color  'Defines the pixel's color.
            Public X As Integer     'Defines the pixel's horizontal position.
            Public Y As Integer     'Defines the pixel's vertical position.
        End Structure
    
    
        Public Sub Main()
            Dim Pixels As New List(Of PixelStr)
            Dim pix1c1, pix1c2, pix1c3, pix2c1, pix2c2, pix2c3, A1, A2, A3 As Integer
            Dim q As Integer
            Dim files_image(BitmapO.Height * BitmapO.Width, 4) As Integer
            For x As Integer = 0 To BitmapO.Width - 1
                For y As Integer = 0 To BitmapO.Height - 1
                    Pixels.Add(New PixelStr With {.ColorO = BitmapO.GetPixel(x, y), .x = x, .y = y})
                Next y
            Next x
            Using FileO As New System.IO.StreamWriter("D:\Codinates_circle.txt")
                For Each Pixel As PixelStr In Pixels
                    With Pixel
                        files_image(q, 0) = .X
                        files_image(q, 1) = .Y
                        files_image(q, 2) = .ColorO.R
                        files_image(q, 3) = .ColorO.G
                        files_image(q, 4) = .ColorO.B
                        q = q + 1
                    End With
                Next Pixel
            End Using
    
            Using Filet As New System.IO.StreamWriter("D:\Codinates_circle4.txt")
                For j As Integer = 0 To BitmapO.Height * BitmapO.Width
                    If j < BitmapO.Height * BitmapO.Width - 50 Then
                        pix1c1 = files_image(j, 2)
                        pix1c2 = files_image(j, 3)
                        pix1c3 = files_image(j, 4)
    
                        End If
    
                    If pix1c1 = 183 or pix1c1=197 Then
                        BitmapO.SetPixel(files_image(j, 0), files_image(j, 1), Color.DarkRed)
                        Filet.WriteLine("{0};{1}", files_image(j, 0), files_image(j, 1))
                   End If
                Next
            End Using
            Try
                BitmapO.Save("D:\maw243.jpg")
            Catch ex As Exception
                MsgBox("Sorry ! We ran into an error.")
            End Try
            AI_Theme_Form4.Show()
            AI_Theme_Form4.PictureBox2.BackgroundImage = Image.FromFile("D:\maw243.jpg")
            AI_Theme_Form4.PictureBox2.BackgroundImageLayout = ImageLayout.Stretch
            BitmapO.Dispose()
        End Sub
    
        Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
            OpenFileDialog1.ShowDialog()
            add = OpenFileDialog1.FileName
            Try
                PictureBox1.BackgroundImage = Image.FromFile(add)
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
            BitmapO = New Bitmap(add)
        End Sub

    I have tried to put everything in the code - it works but only in the first time execution but when i run it again it does not work "A Generic Error Occured in GDI+"
    Last edited by dday9; Jan 14th, 2021 at 10:52 AM.
    < / L R. . . . >

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: A Generic Error Occurred In GDI+

    You need to edit your code and format it with proper indentation. You can do that by selecting your code block in the editor, and clicking the # button above the text editor.
    With regards to your question...

    This code...

    Code:
    Dim img As New Bitmap("C:\Users\Paul\Desktop\it-could-be-you.jpg")
    img.Save("C:\Users\Paul\Desktop\it-could-be-you.jpg", Drawing.Imaging.ImageFormat.Jpeg)
    Results in the error, A generic error occurred in GDI+.

    But this code...

    Code:
    Dim img As New Bitmap("C:\Users\Paul\Desktop\it-could-be-you.jpg")
    Dim img2 As New Bitmap(img)
    img.Dispose()
    img2.Save("C:\Users\Paul\Desktop\it-could-be-you.jpg", Drawing.Imaging.ImageFormat.Jpeg)
    Works without error because the file is no longer open. A file displayed in a PictureBox with Image.FromFile is still open

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by .paul. View Post
    You need to edit your code and format it with proper indentation. You can do that by selecting your code block in the editor, and clicking the # button above the text editor.
    With regards to your question...

    This code...

    Code:
    Dim img As New Bitmap("C:\Users\Paul\Desktop\it-could-be-you.jpg")
    img.Save("C:\Users\Paul\Desktop\it-could-be-you.jpg", Drawing.Imaging.ImageFormat.Jpeg)
    Results in the error, A generic error occurred in GDI+.

    But this code...

    Code:
    Dim img As New Bitmap("C:\Users\Paul\Desktop\it-could-be-you.jpg")
    Dim img2 As New Bitmap(img)
    img.Dispose()
    img2.Save("C:\Users\Paul\Desktop\it-could-be-you.jpg", Drawing.Imaging.ImageFormat.Jpeg)
    Works without error because the file is no longer open. A file displayed in a PictureBox with Image.FromFile is still open



    Ummmm I tried the way you told me but still not working.

    I think you are missing a point that i am uploading an image via picture_box3 - the address of image file is in variable "add". see below

    Code:
    Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
    OpenFileDialog1.ShowDialog()
    add = OpenFileDialog1.FileName
    Try
    PictureBox1.BackgroundImage = Image.FromFile(add)
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    BitmapO = New Bitmap(add)
    End Sub

    after that i am also editing the image basis on pixcel information - see below

    Code:
    If pix1c1 = 183 or pix1c1=197 Then
    BitmapO.SetPixel(files_image(j, 0), files_image(j, 1), Color.DarkRed)
    Filet.WriteLine("{0};{1}", files_image(j, 0), files_image(j, 1))
    End If
    Next
    End Using
    Try
    BitmapO.Save("D:\maw243.jpg")
    Catch ex As Exception
    MsgBox("Sorry ! We ran into an error.")
    End Try


    And now when i applied your method it is showing the non-edited picture as uploaded not the one that is processed


    Can you help me ? -be a bit more specific to what i am doing wrong and how to fix it
    < / L R. . . . >

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    As you suggested here is my code again with proper indentation >


    Code:
    Option Compare Binary
    Option Explicit On
    Option Infer On
    Option Strict On
    Imports System
    Imports System.Collections.Generic
    Imports System.Drawing
    Imports System.IO
    
    Public Class Form13
    Dim add As String
    Dim BitmapO As Bitmap
    Public Structure PixelStr
    Public ColorO As Color 'Defines the pixel's color.
    Public X As Integer 'Defines the pixel's horizontal position.
    Public Y As Integer 'Defines the pixel's vertical position.
    End Structure
    
    
    Public Sub Main()
    Dim Pixels As New List(Of PixelStr)
    Dim pix1c1, pix1c2, pix1c3, pix2c1, pix2c2, pix2c3, A1, A2, A3 As Integer
    Dim q As Integer
    Dim files_image(BitmapO.Height * BitmapO.Width, 4) As Integer
    For x As Integer = 0 To BitmapO.Width - 1
    For y As Integer = 0 To BitmapO.Height - 1
    Pixels.Add(New PixelStr With {.ColorO = BitmapO.GetPixel(x, y), .x = x, .y = y})
    Next y
    Next x
    Using FileO As New System.IO.StreamWriter("D:\Codinates_circle.txt")
    For Each Pixel As PixelStr In Pixels
    With Pixel
    files_image(q, 0) = .X
    files_image(q, 1) = .Y
    files_image(q, 2) = .ColorO.R
    files_image(q, 3) = .ColorO.G
    files_image(q, 4) = .ColorO.B
    q = q + 1
    End With
    Next Pixel
    End Using
    
    Using Filet As New System.IO.StreamWriter("D:\Codinates_circle4.txt")
    For j As Integer = 0 To BitmapO.Height * BitmapO.Width
    If j < BitmapO.Height * BitmapO.Width - 50 Then
    pix1c1 = files_image(j, 2)
    pix1c2 = files_image(j, 3)
    pix1c3 = files_image(j, 4)
    
    End If
    
    If pix1c1 = 183 or pix1c1=197 Then
    BitmapO.SetPixel(files_image(j, 0), files_image(j, 1), Color.DarkRed)
    Filet.WriteLine("{0};{1}", files_image(j, 0), files_image(j, 1))
    End If
    Next
    End Using
    Try
    BitmapO.Save("D:\maw243.jpg")
    Catch ex As Exception
    MsgBox("Sorry ! We ran into an error.")
    End Try
    AI_Theme_Form4.Show()
    AI_Theme_Form4.PictureBox2.BackgroundImage = Image.FromFile("D:\maw243.jpg")
    AI_Theme_Form4.PictureBox2.BackgroundImageLayout = ImageLayout.Stretch
    BitmapO.Dispose()
    End Sub
    
    Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
    OpenFileDialog1.ShowDialog()
    add = OpenFileDialog1.FileName
    Try
    PictureBox1.BackgroundImage = Image.FromFile(add)
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    BitmapO = New Bitmap(add)
    End Sub
    Error - "A Generic Error Occurred in GDI+"
    < / L R. . . . >

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: A Generic Error Occurred In GDI+

    Code:
    Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            BitmapO = New Bitmap(OpenFileDialog1.FileName)
            PictureBox1.BackgroundImage = BitmapO 
            BitmapO.Dispose  ' If this isn't disposed at some point the file specified in OpenFileDialog1.FileName remains open
        End If
    End Sub

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,302

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by lokesh R View Post
    As you suggested here is my code again with proper indentation >
    Really, because I see no indentation at all. It looks like you copied the non-indented code from your rendered post and expected it to magically become indented. Maybe use the original code that actually contains the indentation if you want to display indentation.
    vb.net Code:
    1. Option Compare Binary
    2. Option Explicit On
    3. Option Infer On
    4. Option Strict On
    5. Imports System
    6. Imports System.Collections.Generic
    7. Imports System.Drawing
    8. Imports System.IO
    9.  
    10. Public Class Form13
    11.     Dim add As String
    12.     Dim BitmapO As Bitmap
    13.     Public Structure PixelStr
    14.         Public ColorO As Color  'Defines the pixel's color.
    15.         Public X As Integer     'Defines the pixel's horizontal position.
    16.         Public Y As Integer     'Defines the pixel's vertical position.
    17.     End Structure
    18.  
    19.  
    20.     Public Sub Main()
    21.         Dim Pixels As New List(Of PixelStr)
    22.         Dim pix1c1, pix1c2, pix1c3, pix2c1, pix2c2, pix2c3, A1, A2, A3 As Integer
    23.         Dim q As Integer
    24.         Dim files_image(BitmapO.Height * BitmapO.Width, 4) As Integer
    25.         For x As Integer = 0 To BitmapO.Width - 1
    26.             For y As Integer = 0 To BitmapO.Height - 1
    27.                 Pixels.Add(New PixelStr With {.ColorO = BitmapO.GetPixel(x, y), .x = x, .y = y})
    28.             Next y
    29.         Next x
    30.         Using FileO As New System.IO.StreamWriter("D:\Codinates_circle.txt")
    31.             For Each Pixel As PixelStr In Pixels
    32.                 With Pixel
    33.                     files_image(q, 0) = .X
    34.                     files_image(q, 1) = .Y
    35.                     files_image(q, 2) = .ColorO.R
    36.                     files_image(q, 3) = .ColorO.G
    37.                     files_image(q, 4) = .ColorO.B
    38.                     q = q + 1
    39.                 End With
    40.             Next Pixel
    41.         End Using
    42.  
    43.         Using Filet As New System.IO.StreamWriter("D:\Codinates_circle4.txt")
    44.             For j As Integer = 0 To BitmapO.Height * BitmapO.Width
    45.                 If j < BitmapO.Height * BitmapO.Width - 50 Then
    46.                     pix1c1 = files_image(j, 2)
    47.                     pix1c2 = files_image(j, 3)
    48.                     pix1c3 = files_image(j, 4)
    49.  
    50.                     End If
    51.  
    52.                 If pix1c1 = 183 or pix1c1=197 Then
    53.                     BitmapO.SetPixel(files_image(j, 0), files_image(j, 1), Color.DarkRed)
    54.                     Filet.WriteLine("{0};{1}", files_image(j, 0), files_image(j, 1))
    55.                End If
    56.             Next
    57.         End Using
    58.         Try
    59.             BitmapO.Save("D:\maw243.jpg")
    60.         Catch ex As Exception
    61.             MsgBox("Sorry ! We ran into an error.")
    62.         End Try
    63.         AI_Theme_Form4.Show()
    64.         AI_Theme_Form4.PictureBox2.BackgroundImage = Image.FromFile("D:\maw243.jpg")
    65.         AI_Theme_Form4.PictureBox2.BackgroundImageLayout = ImageLayout.Stretch
    66.         BitmapO.Dispose()
    67.     End Sub
    68.  
    69.     Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
    70.         OpenFileDialog1.ShowDialog()
    71.         add = OpenFileDialog1.FileName
    72.         Try
    73.             PictureBox1.BackgroundImage = Image.FromFile(add)
    74.         Catch ex As Exception
    75.             MsgBox(ex.Message)
    76.         End Try
    77.         BitmapO = New Bitmap(add)
    78.     End Sub

  7. #7

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by .paul. View Post
    Code:
    Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            BitmapO = New Bitmap(OpenFileDialog1.FileName)
            PictureBox1.BackgroundImage = BitmapO 
            BitmapO.Dispose  ' If this isn't disposed at some point the file specified in OpenFileDialog1.FileName remains open
        End If
    End Sub


    NO - Absolutely not >> This is not the case, may be I have not briefed it. You see the things is there are two pictureboxes

    one picturbox uploads the picture and second picturebox show the processed image okay, so i have put try ..catch in both and the error is coming up in the second picturebox that is supposed to be showing the processed image (edited one) and the uploder still works well it shows another image in it. But the error comes in the saving of processing image .

    If you run my code and number the try -catch errors like error1 and 2 instead of exception.message then you will see the error is in the processed image that needs to be saved and then shown in the second box.


    despite that I have also put your code and it does not work
    < / L R. . . . >

  8. #8

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by jmcilhinney View Post
    Really, because I see no indentation at all. It looks like you copied the non-indented code from your rendered post and expected it to magically become indented. Maybe use the original code that actually contains the indentation if you want to display indentation.
    vb.net Code:
    1. Option Compare Binary
    2. Option Explicit On
    3. Option Infer On
    4. Option Strict On
    5. Imports System
    6. Imports System.Collections.Generic
    7. Imports System.Drawing
    8. Imports System.IO
    9.  
    10. Public Class Form13
    11.     Dim add As String
    12.     Dim BitmapO As Bitmap
    13.     Public Structure PixelStr
    14.         Public ColorO As Color  'Defines the pixel's color.
    15.         Public X As Integer     'Defines the pixel's horizontal position.
    16.         Public Y As Integer     'Defines the pixel's vertical position.
    17.     End Structure
    18.  
    19.  
    20.     Public Sub Main()
    21.         Dim Pixels As New List(Of PixelStr)
    22.         Dim pix1c1, pix1c2, pix1c3, pix2c1, pix2c2, pix2c3, A1, A2, A3 As Integer
    23.         Dim q As Integer
    24.         Dim files_image(BitmapO.Height * BitmapO.Width, 4) As Integer
    25.         For x As Integer = 0 To BitmapO.Width - 1
    26.             For y As Integer = 0 To BitmapO.Height - 1
    27.                 Pixels.Add(New PixelStr With {.ColorO = BitmapO.GetPixel(x, y), .x = x, .y = y})
    28.             Next y
    29.         Next x
    30.         Using FileO As New System.IO.StreamWriter("D:\Codinates_circle.txt")
    31.             For Each Pixel As PixelStr In Pixels
    32.                 With Pixel
    33.                     files_image(q, 0) = .X
    34.                     files_image(q, 1) = .Y
    35.                     files_image(q, 2) = .ColorO.R
    36.                     files_image(q, 3) = .ColorO.G
    37.                     files_image(q, 4) = .ColorO.B
    38.                     q = q + 1
    39.                 End With
    40.             Next Pixel
    41.         End Using
    42.  
    43.         Using Filet As New System.IO.StreamWriter("D:\Codinates_circle4.txt")
    44.             For j As Integer = 0 To BitmapO.Height * BitmapO.Width
    45.                 If j < BitmapO.Height * BitmapO.Width - 50 Then
    46.                     pix1c1 = files_image(j, 2)
    47.                     pix1c2 = files_image(j, 3)
    48.                     pix1c3 = files_image(j, 4)
    49.  
    50.                     End If
    51.  
    52.                 If pix1c1 = 183 or pix1c1=197 Then
    53.                     BitmapO.SetPixel(files_image(j, 0), files_image(j, 1), Color.DarkRed)
    54.                     Filet.WriteLine("{0};{1}", files_image(j, 0), files_image(j, 1))
    55.                End If
    56.             Next
    57.         End Using
    58.         Try
    59.             BitmapO.Save("D:\maw243.jpg")
    60.         Catch ex As Exception
    61.             MsgBox("Sorry ! We ran into an error.")
    62.         End Try
    63.         AI_Theme_Form4.Show()
    64.         AI_Theme_Form4.PictureBox2.BackgroundImage = Image.FromFile("D:\maw243.jpg")
    65.         AI_Theme_Form4.PictureBox2.BackgroundImageLayout = ImageLayout.Stretch
    66.         BitmapO.Dispose()
    67.     End Sub
    68.  
    69.     Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
    70.         OpenFileDialog1.ShowDialog()
    71.         add = OpenFileDialog1.FileName
    72.         Try
    73.             PictureBox1.BackgroundImage = Image.FromFile(add)
    74.         Catch ex As Exception
    75.             MsgBox(ex.Message)
    76.         End Try
    77.         BitmapO = New Bitmap(add)
    78.     End Sub
    I am sorry !! may be i do not know the indentation word meaning >> are your referring to the tabbed code as in visual basic 2010 with "-" sign on the left
    < / L R. . . . >

  9. #9
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: A Generic Error Occurred In GDI+

    Look at the difference between your code and everyone else’s code in this thread. Indented code is what you see here and also in your VS editor

  10. #10
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: A Generic Error Occurred In GDI+

    Try loading the image with PictureBox.Load

    https://docs.microsoft.com/en-us/dot...d?view=net-5.0

  11. #11

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by .paul. View Post
    Look at the difference between your code and everyone else’s code in this thread. Indented code is what you see here and also in your VS editor
    okay , got it the indexes along with the lines of the code. Will take care from now on !
    < / L R. . . . >

  12. #12

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by .paul. View Post
    Try loading the image with PictureBox.Load

    https://docs.microsoft.com/en-us/dot...d?view=net-5.0
    okay , will try that and then confirm
    < / L R. . . . >

  13. #13

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by lokesh R View Post
    okay , will try that and then confirm
    I tried , but the error comes first and it does not work. And one more thing do you know how to enable the indexes in VS-2010 I have attached a screenshot i do not think that my Visual Studio 2010 has indentation .Attachment 179865
    < / L R. . . . >

  14. #14
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: A Generic Error Occurred In GDI+

    You don't need the line numbers. Your code (in your VS editor) does have indentation

  15. #15

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by .paul. View Post
    You don't need the line numbers. Your code (in your VS editor) does have indentation
    Yes, I got it - VS2010 does not do auto intent but i have enabled them in Tools-> Text Editor->Basic->Editor->Indent Type="Smart"-> Interaction ="Line Numbers"

    its good to know information will help me to put it on the form with indent !

    But Still I have not figured what to do with that GDI+ Error ?
    < / L R. . . . >

  16. #16

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Somebody Help me ->>>>>
    < / L R. . . . >

  17. #17
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,466

    Re: A Generic Error Occurred In GDI+

    I told you. Something in your application has opened your file and it remains open, thereby locking the file..

  18. #18

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by .paul. View Post
    I told you. Something in your application has opened your file and it remains open, thereby locking the file..
    I have been redefining it but no luck !!! can someone please fix it
    < / L R. . . . >

  19. #19

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by lokesh R View Post
    I have been redefining it but no luck !!! can someone please fix it
    Got it . I was not able to close a form and the other picturebox was on this second form this was not getting dispossed. Now it is working fine.

    Thank you Paul >>
    < / L R. . . . >

  20. #20

    Thread Starter
    Member
    Join Date
    Jan 2021
    Location
    Kepler-452b
    Posts
    37

    Re: A Generic Error Occurred In GDI+

    Quote Originally Posted by .paul. View Post
    I told you. Something in your application has opened your file and it remains open, thereby locking the file..
    Thank you !!
    < / L R. . . . >

  21. #21
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: [RESOLVED] A Generic Error Occurred In GDI+

    Indenting on this forum is a bit of magic. If you copy indented form from VS, sure, THEN you get indenting, but you can do less than that, too. If you write freehand into a post, then a single space will tend to be extended into a tab when inside the [CODE][/CODE] tags. I've made a fair amount of use of that, though I've never really taken any time to understand it completely.
    My usual boring signature: Nothing

Posting Permissions

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



Click Here to Expand Forum to Full Width