imagebutton error

Discussion in 'Questions (Windows Mobile)' started by kolbe, Mar 11, 2008.

  1. kolbe

    kolbe Active Member Licensed User

    Hello all,

    The following code gives me an out of memory error IDE error. The error is on the last line when I assign the imagebutton1.image to bin.retrieveimage. There are several images embedded in data.dat. If I change imagebutton1.image to image1.image all is fine. Using version 6.05.

    Code:
    FileOpen(c1,"data.dat",cRandom)
    bin.New1(c1,
    true)
    image1.Image=bin.RetrieveImage
    imagebutton1.Image=bin.RetrieveImage
    FileClose(c1)
    The error is the following:

    Any ideas?

    Thanks
     
  2. skipper

    skipper Member Licensed User

    I never used RetrieveImage, but I suppose that in order to embed several images into the .dat file you used the EmbedFile command.
    Have you alredy tried the Retrievefile?
    Have you tried to switch the "Image" instruction with the "imageButton" instruction just to see if the program behaviour changes?
    It seems to me, but I'm not an expert, that RetrieveImage could raise the error for 2 reason
    1) he starts reading at an offset of the .dat file where there are no information about the image file (something has been already read by the image instruction and the pointer has been moved)
    2) he can read only an image (there are no parameters to specify what and where to read inside the .dat)
    But as I said I could be totally wrong..
    Mimmo
     
  3. kolbe

    kolbe Active Member Licensed User

    skipper,

    I did use the embedfile command to create the data.dat. All works fine if I use image1.image or form1.image with bin.retrieveimage, so I know data.dat is OK. It is only when I use imagebutton1.image that I get this error. My understanding is that a bitmap is passed by bin.retrieveimage and then should work for all object.image. Imagebutton1.image="file.gif" works as well. I think it might be a bug of some kind.

    thanks
     
  4. klaus

    klaus Expert Licensed User

    Bonjour kolbe

    I had the same kind of problem.

    Your ImageButton1 is probably set to transparent, in this case you get an error.
    If you set transparent to false and after loading the image you set it to transparent it works.

    Look under

    http://www.basic4ppc.com/forum/showthread.php?t=1766

    Meilleures salutations
    Klaus
    Switzerland
     
Loading...