Error loading program. OutOfMemeoryException

Discussion in 'Questions (Windows Mobile)' started by mjcoon, Sep 9, 2009.

  1. mjcoon

    mjcoon Well-Known Member Licensed User

    I started building this MP3 player from a shared offering here though there's little of the original left!

    It's been working on PC and WM5 device OK so far, but stopped today. Latest changes have been addition of some buttons of very modest size. So I am baffled as to why I get this failure on my device which reports 46Mb "storage" and 25Mb "program" memory. I'm running the program itself out of the SD card.

    I think I've attached all the files needed to build it as well as the built device EXE.

    Any advice, please?

    TIA, Mike.
     
  2. mjcoon

    mjcoon Well-Known Member Licensed User

    I've followed my own hint and got it sorted!

    I was using *.ico files for my buttons, despite that fact that browsing for button images does not show these files. I did it because I wanted transparent borders. But I have discovered that .png files also allow borders, can be browsed for, and work on the device as well as on the PC.

    A strange mire to get stuck in, but at least I'm out and can document it as an Awful Warning!

    Mike.
     
  3. klaus

    klaus Expert Licensed User

    For ImageButtons you can use PNG, BMP, JPG files perhaps even other formats.

    For the transparency, the system set all pixels having the same color as the upper left pixel Pixel(0,0) transparent. See the ImageButton's help file.

    I am using BMP files, I tried JPG files but had trouble with those because surfaces with the same color (transparent color) didn't have this color any more and parts of the surface were no more transparent. I've never used PNG files.

    Best regards.
     
  4. mjcoon

    mjcoon Well-Known Member Licensed User

    Thanks Klaus, I had read but forgotten the mention of Pixel(0,0).

    I have now put a coloured Panel behing my image-buttons, expecting that the panel colour would show through the transparent part of the button. But it doesn't; it is the Form colour that shows. So how does transparency work, and can I get the effect of each panel showing through its buttons? (For other controls I am using the background colour property, setting it to the panel colour, which works fine.)
     
  5. agraham

    agraham Expert Licensed User

    The image button copies its parents' background image to itself for transparency so you need to change the parent of the image buttons from the form to the panel using FormLib.ChangeParent.
     
  6. mjcoon

    mjcoon Well-Known Member Licensed User

    Terrific, thanks again Andrew. It was a bit laborious because the positions seemed to change arbitrarily as well as being relative to new datums, but it worked...
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice