Function TWPCustomRtfEdit.GetImageAtXY(X:Integer; Y:Integer; img_x:Integer; img_y:Integer; img_w:Integer; img_h:Integer) : TWPTextObj
Unit: WPCTRMemo
Class: WPCTRMemo.TWPCustomRtfEdit
Parameters
-
X:Integer Y:Integer img_x:Integer img_y:Integer img_w:Integer img_h:Integer
Returns
The type of the result value is TWPTextObj.
Description
This function locates an image at a certain screen position. It modifies the variables img_x, img_y, img_w,img_h accordingly. This function can be used to locate images which are placed in header or footer texts.
procedure TForm1.WPRichText1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
var ix, iy, iw, ih : Integer;
img : TWPTextObj;
begin
img := WPRichText1.GetImageAtXY(X,Y,ix, iy, iw, ih);
if img<>nil then
begin
WPRichText1.Canvas.Pen.Color := clRed;
WPRichText1.Canvas.Brush.Style := bsClear;
WPRichText1.Canvas.Rectangle(ix,iy,ix+iw,iy+ih);
end;
end;