Hi,
You could try painting it directly in the backbuffer like this...
procedure TfrmMain.imgViewDrawBackBuffer(Sender: TObject);
type
PRGBArr = ^TRGBArr;
TRGBArr = array[0..32768] of TRGB;
const
cMagenta: TRGB = (b: 255; g: 0;r: 255);
cWhite: TRGB = (b: 255; g: 255;r: 255);
var
rx, ry, rw, rh, sx, sy, sw, sh: Integer;
y, x, i, j: Integer;
SL: PRGBArr;
Color: TRGB;
begin
if chkSplit.Checked then begin
imgView.GetRenderRectangles(rx, ry, rw, rh, sx, sy, sw, sh);
// Position splitter in the middle of the view when activated
if SplitPos = -1 then SplitPos:= (sw shr 1) + sx;
x:= imgView.XBmp2Scr(SplitPos); // Get splitter x position
// Draw splitter
if (x > 0) and (x < imgView.ClientWidth) then begin
i:= 1;
Color:= cMagenta;
for y:= 0 to imgView.ClientHeight - 1 do begin
SL:= imgView.BackBuffer.ScanLine[y];
if y mod 4 = 0 then begin
i:= -i;
if i = -1 then Color:= cMagenta else Color:= cWhite;
end;
SL[x]:= Color;
end;
end;
end;
end;
Roy M Klever
Klever on Delphi - www.rmklever.com