Original Post
I've experienced poor image quality while rendering an image to
the primary surface when there are overlapping windows on top of the blitted image. There are annoying horizontal image errors according to the window position. (DX7 is in use)

Here is my little code fragment in Delphi:
I suppose I have a problem with the incorrect setting of the clipper object, but I'm not sure.
Any idea?
[edited by - xropi on January 6, 2003 8:43:29 AM]

Here is my little code fragment in Delphi:
try
hr := FDirectDraw.SetCooperativeLevel(ViewPanel.Handle, DDSCL_NORMAL);
if hr <> DD_OK then raise Exception.Create(DDErrorString(hr));
SurfaceDesc.dwSize := sizeof(SurfaceDesc);
SurfaceDesc.dwFlags := DDSD_CAPS;
SurfaceDesc.ddsCaps.dwCaps := DDSCAPS_PRIMARYSURFACE;
hr := FDirectDraw.CreateSurface(SurfaceDesc, FPrimarySurface, nil);
if hr <> DD_OK then raise Exception.Create(DDErrorString(hr));
hr := FDirectDraw.CreateClipper(0, FClipper, nil);
if hr <> DD_OK then raise Exception.Create(DDErrorString(hr));
hr := FClipper.SetHWnd(0, ViewPanel.Handle);
if hr <> DD_OK then raise Exception.Create(DDErrorString(hr));
hr := FPrimarySurface.SetClipper(FClipper);
if hr <> DD_OK then raise Exception.Create(DDErrorString(hr));
except
On E : Exception do
begin
ErrDlg(Format(rssErrorInitDirectDraw, [E.Message]));
raise Exception.Create('TCameraView.Create:' + E.Message); //!!!!!
end;
end;