"Canvas does not allow drawing" document with SRVControls
Posted: Fri Feb 21, 2020 6:41 pm
After inserting jpg in RVHeader, from a document with SRV Controls I got an error "canvas does not allow drawing".........
Support forums for TRichView, ScaleRichView, Report Workshop and RVMedia components
https://richedit.com/forums/
Code: Select all
// srv must be formatted when calling this code, and RVHeader must not be hidden
cabec:=TJpegImage.create;
cabec.loadfromfile(vCaminhoImagens+'\logo.'+formatzero(5,strtoint(gCodigoClinica))+'.jpg');
editor1.srv.StartEditing(srvrveHeader);
editor1.srv.RVHeader.InsertPicture('cabec', cabec, rvvaLeft);
Code: Select all
// srv must be either unformatted, or the main editor must be active
// if srv is formatted, you can make sure that the main editor is active by calling editor1.srv.StartEditing(srvrveMain)
// before this code
cabec:=TJpegImage.create;
cabec.loadfromfile(vCaminhoImagens+'\logo.'+formatzero(5,strtoint(gCodigoClinica))+'.jpg');
with editor1.srv.SubDocuments[srvhftNormalHeader] do
begin
Clear;
AddPicture('cabec', cabec, 0, rvvaLeft);
Add('', 0); // for any case, adding one non-floating text object in the header)
end;
editor1.srv.Format;