PicShow and huge images

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

PicShow and huge images

Postby mhieta » December 20th, 2007, 5:21 pm

Hi,

1. I will use this for putting images in to PicShow:

Code: Select all
procedure CopyGraphicToBitmap(Graphic: TGraphic; Bitmap: TBitmap;
  MaxWidth, MaxHeight: Integer; ShrinkOnly: Boolean);
var
  Width, Height: Integer;
begin
  Width := Graphic.Width;
  Height := Graphic.Height;
  if not ShrinkOnly or (Width > MaxWidth) or (Height > MaxHeight) then
  begin
    if (MaxWidth / Width) < (MaxHeight / Height) then
    begin
      Height := MulDiv(Height, MaxWidth, Width);
      Width := MaxWidth;
    end
    else
    begin
      Width := MulDiv(Width, MaxHeight, Height);
      Height := MaxHeight;
    end;
  end;
  Bitmap.Width := Width;
  Bitmap.Height := Height;
  with Bitmap.Canvas do StretchDraw(ClipRect, Graphic);
end;


But there is one issue. When image is loaded with this and window is small:
Code: Select all
          CopyGraphicToBitmap(P.Graphic, PicShow.Picture.Bitmap,
            PicShow.Width, PicShow.Height, True);

Problem is when user maximizes the window then user gets that small image what is resized with this CopyGraphic...
If I change that to this:
Code: Select all
          CopyGraphicToBitmap(P.Graphic, PicShow.Picture.Bitmap,
            Screen.Width, Screen.Height, True);

Same problem occurs if user has multiple monitors and resolutions are different.

2. Without that CopyGraphicToBitmap PicShow cannot handly huge images ex. 3800 x 2500. This size is problem ex. in Win98, XP can handle bigger images, but still problem is there.

So is there any way to load and display huge images so that they are fitted to screen?

- Marko
mhieta
Active Member
Active Member
 
Posts: 22
Joined: November 16th, 2005, 7:58 pm

Postby Kambiz » December 20th, 2007, 8:45 pm

Suggestion: Resize the image to screen size of the monitor with the largest screen size.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby mhieta » December 21st, 2007, 6:44 pm

Yes that might be solution for this problem at least for now.
Cause display resolutions are still small.
Except if the user has ex. this:
http://www.eizo.com/products/lcd/SX3031W/index.asp
2560 × 1600 native resolution
Then its a problem for older OS ex. Win98. Sooner or later I have to drop supporting those older OS.

Anyway thanks and Merry Christmas.

- Marko
mhieta
Active Member
Active Member
 
Posts: 22
Joined: November 16th, 2005, 7:58 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 2 guests

cron