Ignore:
Timestamp:
Sep 15, 2024, 5:34:07 PM (8 weeks ago)
Author:
chronos
Message:
  • Modified: Do not use Screen Width and Height values for Offscreen bitmap size initialization to improve multi monitor support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/BaseWin.pas

    r567 r620  
    6969  SideFrame = 9;
    7070
    71 procedure CreateOffscreen(var Offscreen: TBitmap);
     71procedure CreateOffscreen(var Offscreen: TBitmap; Width, Height: Integer);
    7272function WindowModeMakePersistent(Mode: TWindowMode): TWindowMode;
    7373procedure Register;
     
    9393constructor TBufferedDrawDlg.Create(AOwner: TComponent);
    9494begin
    95   BaseWin.CreateOffscreen(Offscreen);
     95  BaseWin.CreateOffscreen(Offscreen, Width, Height);
    9696  OnClose := FormClose;
    9797  OnPaint := FormPaint;
     
    159159procedure TBufferedDrawDlg.OffscreenPaint;
    160160begin
     161  BaseWin.CreateOffscreen(Offscreen, Width, Height);
    161162  if (OffscreenUser <> nil) and (OffscreenUser <> Self) then
    162163    OffscreenUser.Update; // complete working with old owner to prevent rebound
     
    332333  Frame(Canvas, SideFrame - 1, TitleHeight - 1, ClientWidth - SideFrame,
    333334    InnerBottom, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    334   // RFrame(Canvas,SideFrame-2,TitleHeight-2,ClientWidth-SideFrame+1,
    335   // InnerBottom+1,MainTexture.ColorBevelShade,MainTexture.ColorBevelLight);
     335  // RFrame(Canvas,SideFrame - 2, TitleHeight - 2, ClientWidth - SideFrame + 1,
     336  // InnerBottom + 1, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    336337  if FullCaption then begin
    337338    if (FWindowMode <> wmModal) or not ModalIndication then
     
    475476end;
    476477
    477 procedure CreateOffscreen(var Offscreen: TBitmap);
     478procedure CreateOffscreen(var Offscreen: TBitmap; Width, Height: Integer);
    478479var
    479480  NewWidth: Integer;
     
    484485    Offscreen.PixelFormat := TPixelFormat.pf24bit;
    485486  end;
    486   if Screen.Height - yUnused < 480 then begin
    487     NewWidth := Screen.Width;
     487  if Height - yUnused < 480 then begin
     488    NewWidth := Width;
    488489    NewHeight := 480;
    489490  end else begin
    490     NewWidth := Screen.Width;
    491     NewHeight := Screen.Height - yUnused;
     491    NewWidth := Width;
     492    NewHeight := Height - yUnused;
    492493  end;
    493494  if (Offscreen.Width <> NewWidth) or (Offscreen.Height <> NewHeight) then begin
Note: See TracChangeset for help on using the changeset viewer.