Background image problem when screen orientation changes

Discussion in 'Questions (Windows Mobile)' started by bluedude, Jul 22, 2009.

  1. bluedude

    bluedude Well-Known Member Licensed User

    Hi,

    I have set a background image and that works fine when I initialize the app but when I change the screen orientation it disappears and my background just shows a grey color.

    Any ideas how to do this? I already use formlib to catch the screen orientation event.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You will need to redraw the image in the orientation change event.
    The graphic layer is recreated every time (as the size of the screen changes) so all drawings are lost.
     
  3. bluedude

    bluedude Well-Known Member Licensed User

    Redraw

    I assume you mean Form1.drawimage
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I meant that you will need to manually redraw the background image similar to how you did it before.
    If you have used Form1.Image = "some image" then you should also do it in the orientation changed event.
     
  5. bluedude

    bluedude Well-Known Member Licensed User

    REdraw

    Ok, did not do that. Just added a background image to the form with the IDE and assumed it would handle it perfectly automatically.

    So that basically means I need to also provide the image on the device in a folder. Right now if I add it through the IDE it gets added to the .exe right?

    Thanks.
     
  6. klaus

    klaus Expert Licensed User

    You can also put the image or images in an ImageList and add the image files in the IDE. Basic4ppc - Main Help
    In that case the images are also embedded into the exe file.

    Best regards.
     
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