Question about DrawImage on Image

Discussion in 'Questions (Windows Mobile)' started by DaveW, Nov 6, 2008.

  1. DaveW

    DaveW Active Member Licensed User

    Must be a simple newbie thing, but I have found that:


    works but


    does not. The second version gives an error "variable main.image1 was not assigned any value."

    if I put

    image1.Image = bmp.Value

    before it, it does work. I don't understand that. Image1 is a control on the form, it's *there*, just like the form, so why does it have to be assigned a value? The need for image1.image = bmp.value seems to imply that Image1 is not an 'image' in it's own right, it is just a frame that can hold images.

    Am I missing something or not understanding the situation?

    Attached Files:

    Last edited: Nov 6, 2008
  2. agraham

    agraham Expert Licensed User

    You've got it in one! The Image control is a visible container that draws bitmaps on the screen. The Drawer draws on bitmaps, not on the Image control. You can make a new Bitmap, draw on it and then assign it to an Image for display, you don't have to draw on it when it is in an Image control as a Bitmap exists in its own right.
  3. DaveW

    DaveW Active Member Licensed User

    I hate when I am right :sign0148: I just wish it had not taken about 6 hours to work it out!

    As always, thanks for the speedy and cheerful answer :)
  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