locked
Load image crash RRS feed

  • Question

  • I can load an image (closeicon) to the graphic window but when I try to load another one (newicon) the program crashes, do I have to clear the memory before the second will load? Any suggestions are greatly appreciated. Here is my code;

    CloseIcon = ImageList.LoadImage ("C:\Documents and Settings\Steve\Desktop\JMI sb\form-s.bmp")
    ImageList.GetHeightOfImage (CloseIcon)
    ImageList.GetWidthOfImage (CloseIcon)
    GraphicsWindow.DrawResizedImage(CloseIcon,510,20,35,35)
    NewIcon = ImageList.LoadImage ("C:\Documents and Settings\Steve\Desktop\JMI sb\new item.bmp")
    'ImageList.GetHeightOfImage (NewIcon)
    'ImageList.GetWidthOfImage (NewIcon)
    'GraphicsWindow.DrawResizedImage(NewIcon,555,20,35,35)
    Sunday, May 10, 2009 2:54 AM

Answers

  • I can only get your program to crash by not having the correct path and file names. (I substituted yours for two of my own). Are you sure the path and file names are correct? Try swapping these over and seeing if your program now crashes on the first one. Alternatively, copy the first file load to the second one. i.e.,

    NewIcon = ImageList.LoadImage ("C:\Documents and Settings\Steve\Desktop\JMI sb\form-s.bmp")

    If this works there is probably something wrong with the path or file name of the second file.

    • Marked as answer by Vijaye Raji Sunday, May 10, 2009 8:19 PM
    Sunday, May 10, 2009 10:57 AM

All replies

  • I can only get your program to crash by not having the correct path and file names. (I substituted yours for two of my own). Are you sure the path and file names are correct? Try swapping these over and seeing if your program now crashes on the first one. Alternatively, copy the first file load to the second one. i.e.,

    NewIcon = ImageList.LoadImage ("C:\Documents and Settings\Steve\Desktop\JMI sb\form-s.bmp")

    If this works there is probably something wrong with the path or file name of the second file.

    • Marked as answer by Vijaye Raji Sunday, May 10, 2009 8:19 PM
    Sunday, May 10, 2009 10:57 AM
  • Thanks!
    That was the problem, wrong file name. I appreciate you taking the time to help.
    Sunday, May 10, 2009 5:14 PM