Login  Register

Re: Unconvinient refresh in image presenter

Posted by Chris Uppal-3 on Jul 03, 2006; 11:00am
URL: https://forum.world.st/Unconvinient-refresh-in-image-presenter-tp3379298p3379305.html

Sebastián,

>   It happens to me, using #viewMode: #scaleToFit, that when I maximize
> and then restore the window, when the image is wider than taller, the
> parts without image (those boxes on the window that are not a
> proportional part of the box of the resized image) are maintaining the
> parts of the previous maximized image.

That seems to be a bug somewhere in D6.

In D5, you can avoid that behaviour by setting the view's #isEraseBackground to
true, /and/ the #backcolor to something non-nil   So the following works OK in
D5.

    f := 'C:\someFile.jpg'.
    i := GdiplusImage fromFile: f.
    p := ImagePresenter show: 'Gdiplus view' on: i.
    (p view)
        backcolor: (Color yellow fadedBy: 4);
        isEraseBackground: true;
        viewMode: #scaleBestFit;
        invalidate.

The view erases itself as you change the size or maximise it.

But that doesn't work under D6.  I don't know why, but one hint is that the
view doesn't seem to have passed its background color to the underlying
control.

    -- chris