Error when processing insertpicture.
Posted: Tue Jun 28, 2016 4:13 am
here is my code for finding text and insertpicture, but i keep getting invalid pointer error.
Code: Select all
procedure TfrmHKLDocuments.SearchAndReplaceImage(InSearch: string; NewImage : TWICImage);
var
APos: Integer;
begin
_bitmap := TBitmap.Create;
_bitmap.Assign(nil);
_bitmap.Assign(NewImage);
ResizeBitmap(_bitmap, 210, 40, clWhite);
begin
rveDoc.ActiveEditor.SetSelectionBounds(
0, rveDoc.ActiveEditor.GetOffsBeforeItem(0),
0, rveDoc.ActiveEditor.GetOffsBeforeItem(0));
while (rveDoc.ActiveEditor.SearchText(InSearch,[RVEdit.TRVESearchOption.rvseoDown
])) do
begin
rveDoc.RichViewEdit.InsertPicture('',_bitmap, rvvaBaseline);
end;
end;
end;