Hello,
I am displaying an image within an ImageView on a Panel. The ImageView gravity is "Fill". The image within the ImageView starts out as a square "noise" pattern. I then resize the image view and display a bitmap file from the camera (it turns out the aspect ratio of the bitmap is narrower than the original image). I resize and reposition the ImageView, but this does not happen properly. There seem to be artifacts left over from the original image within the ImageView which are not invalidated, erased, or redrawn properly.
I have attached pictures which illustrate this issue. The first picture shows the initial square noise pattern. The second picture shows the result of resizing the ImageView and setting the bitmap to a picture file (from the camera). The resized Image View becomes narrower and is moved to the right in order to center on the screen. The new bitmap is aligned to the left side of the ImageView, but the right side of the Image View shows the previous noise bitmap in an area which should no longer be displayed within the resized ImageView.
I have tried many different things, including: invalidating the ImageView and/or parent panel, calling DoEvents, resetting the color of the parent panel to white hoping this will force a refresh of the entire panel. Nothing seems to work.
Any ideas how to get the Image View to redraw correctly and have the parent panel erase the background which is uncovered by the resized Image View?
Thanks,
Barry.
I am displaying an image within an ImageView on a Panel. The ImageView gravity is "Fill". The image within the ImageView starts out as a square "noise" pattern. I then resize the image view and display a bitmap file from the camera (it turns out the aspect ratio of the bitmap is narrower than the original image). I resize and reposition the ImageView, but this does not happen properly. There seem to be artifacts left over from the original image within the ImageView which are not invalidated, erased, or redrawn properly.
I have attached pictures which illustrate this issue. The first picture shows the initial square noise pattern. The second picture shows the result of resizing the ImageView and setting the bitmap to a picture file (from the camera). The resized Image View becomes narrower and is moved to the right in order to center on the screen. The new bitmap is aligned to the left side of the ImageView, but the right side of the Image View shows the previous noise bitmap in an area which should no longer be displayed within the resized ImageView.
I have tried many different things, including: invalidating the ImageView and/or parent panel, calling DoEvents, resetting the color of the parent panel to white hoping this will force a refresh of the entire panel. Nothing seems to work.
Any ideas how to get the Image View to redraw correctly and have the parent panel erase the background which is uncovered by the resized Image View?
Thanks,
Barry.