Save information drawn on a form

Discussion in 'Questions (Windows Mobile)' started by maxtillberg, Nov 4, 2007.

  1. maxtillberg

    maxtillberg Member Licensed User

    Hi,
    I have used the ImageLib library to draw a rather complex image on the form made out of a hundred small images (with transparency) and some text. From time to time I plan to cover the entire screen with a messagewindow made of a large image with text on it and wonder if anybody knows of a way to store the original information (in a bitmap?) of the form so I can restore the screen after the messagewindow is closed without redraw all the hundres small images?

    I have tried to draw the messagewindow on the forelayer but this causes the screen to flicker (I don't konw how to stop the automatic refresh of the forelayer). I have also tried to use images and imagebuttons but they don't handle transparency or positioning of the text.

    Sincerely,
    Max Tillberg
     
  2. agraham

    agraham Expert Licensed User

    Could you use a second separate form for the message window?
     
  3. maxtillberg

    maxtillberg Member Licensed User

    I never thought of that, I will try it. Thanks.

    Sincerely,
    Max Tillberg
     
  4. maxtillberg

    maxtillberg Member Licensed User

    To be able to use two full screen forms I guess I have to use the following code
    Code:
    Sub App_Start
    [INDENT]Form1.Show
    flb.New1(
    "Form1",B4PObject(1))
    flb.FullScreen(CPPC)
    flb.New1(
    "Form2",B4PObject(1))
    flb.FullScreen(CPPC)
    drawer.New1(
    "Form1",false)[/INDENT]
    End Sub

    drawer.New1(
    "Form2",false'After a button is pressed
    '...Draw the information on Form2

    'And finaly
    Form2.Close 'after a new button is pressed
    Is this the best way to work with two forms?

    Sincerely,
    Max Tillberg
     
  5. Cableguy

    Cableguy Expert Licensed User

    Not too sure but, i was under the impression that, once in fullscreen, all forms were afected by the setting...

    As I sai, not sure...
    Your code look correct, still I would suggest that you create 2 diferent objects for the forms, so that you can use the library in a more restrictive way...
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    As Cableguy wrote you should add two FormLib objects (one for each form).
     
  7. maxtillberg

    maxtillberg Member Licensed User

    The second form was fullscreen on the PC but not the PocketPC.

    I added a second formlib and changed the code to

    flb1.New1("Form1",B4PObject(1))
    flb1.FullScreen(CPPC)
    flb2.New1("Form2",B4PObject(1))
    flb2.FullScreen(CPPC)

    Should I use two drawers as well?

    Sincerely,
    Max Tillberg
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    If you use drawers to draw on the forms then you should create one for each form.
     
  9. maxtillberg

    maxtillberg Member Licensed User

    Hi again,
    One more question about using two full screen forms. When I run the program on a PC the program window remember it's position for each form; if I move the progam window when the message window form is open, the entire program moves to it's original position when I hide this form. Is there a way to avoid this?

    Sincerely,
    Max Tillberg
     
  10. agraham

    agraham Expert Licensed User

  11. maxtillberg

    maxtillberg Member Licensed User

    Thanks a lot,
    I was wondering why a form had width and height but no top and left position.

    As I plan was to relese a PC version of my game I wonder if there is a way to get rid of the border and close button as they are rather ugly.

    Sincerely,
    Max Tillberg
     
Loading...