trichview.support
Re: Deleting all bitmaps in a document (TDBRichViewEdit) |
Author |
Message |
Sergey Tkachenko |
Posted: 10/31/2002 17:27:58 > procedure DeleteBMPS(RVData: TCustomRVData); > var i: Integer; > begin > > i := 0 ; > while i < RVData.Items.Count do begin > if RVData.GetItemStyle(i)=rvsPicture then > RVData.DeleteItems(i,1) > else Inc(i) ; > end ; > > end; This method should work. But do not forget to call Format after it. However, in some cases, there can be some problems with line breaks. Here is an advanced version: procedure DeleteBMPS(RVData: TCustomRVData); var i: Integer; ps: Boolean; begin for i := RVData.Items.Count-1 downto 0 do begin ps := RVData.IsParaStart(i); RVData.DeleteItems(i,1); if ps and (i<RVData.Items.Count) and not RVData.IsParaStart(i) then RVData.GetItem(i).SameAsPrev := False; end; end; Besides, you can consider storing pictures outside documents (in files or in a database). Here is a demo: http://www.trichview.com/support/files/sharedimages.zip This demo works with RVF files containing external images. Images are stored in the special subdirectory (called Images) and can be shared among several RVF document. |
Powered by ABC Amber Outlook Express Converter