WinXP
Delphi 6
Lib: unDelphiX

Hi everyone, I have the following constructor to implement a fade routine in my game made with DelphiX. Problem is that it only works in full screen mode and not windowed mode. It seems as if image rect tries to draw a rectangle over the whole screen area whereas I need it to draw a rectangle over the control’s client area (the window). Any help is appreciated :-)

Code:
Constructor TFade.Create(Parent: TSprite);
var ImageRect : TRect;
    Alpha: integer;
begin
  inherited Create(Parent);
  Alpha := Min(Round(255*0.3),255); 
  ImageRect.Left := round(0);
  ImageRect.Top := round(0);
  ImageRect.Right := ImageRect.Left + formGame.dxdrawgame.Width;
  ImageRect.Bottom := ImageRect.Top + formGame.dxdrawgame.Height;
  formGame.DXImageList.Items[formGame.fadingImageIndex].DrawAlpha(formGame.DXDrawGame.Surface,ImageRect,0,Alpha);
end;