Page 1 of 1

PicShow and resize currently shown image

PostPosted: November 16th, 2005, 8:10 pm
by mhieta
Hi,

Firstly thanks for great component.

Is there anyway to resize currently shown image?
I'm currently resizing image in "LoadNext" function. Like this way:
Code: Select all
    if CreateCustomButton1.Enabled = True then  //if custom show is enabled then load images from there.
    begin
      P := TPicture.Create;
      try
        P.LoadFromFile(PicPath + LoadedImage);
        CopyGraphicToBitmap(P.Graphic, PicShow.Picture.Bitmap,
          PicShow.Width, PicShow.Height, True);
      finally
        P.Free;
      end;
    end;

So if user resizes window then he/she gets resized picture after one loaded picture.

PostPosted: November 17th, 2005, 10:16 am
by Kambiz
You can set both Stretch and StretchFine properties to True, and load the image as follow:

Code: Select all
      P := TPicture.Create;
      try
        P.LoadFromFile(PicPath + LoadedImage);
        CopyGraphicToBitmap(P.Graphic, PicShow.Picture.Bitmap,
          Screen.Width, Screen.Height, True);
      finally
        P.Free;
      end;

PostPosted: November 17th, 2005, 6:42 pm
by mhieta
hmm. I forget to tell that i'm using PicShow 3.12 with graphics32 1.7.1.
If i use that Stretch property then i'm getting this "error": Source rectangle is invalid. And that is pointing to graphics32 code. So whats next? :)

PostPosted: November 17th, 2005, 9:38 pm
by Kambiz
I don't know about Graphics32.

As an idea: when you need to reload the image, show it without any transition effect.

PostPosted: November 18th, 2005, 3:54 pm
by mhieta
Ok, thanks for the tip. It seems that i have to update graphics32 in to latest version and hope that it fixed there.