johnmie Active Member Licensed User Longtime User Jul 2, 2022 #1 My app is a CLV expandable list where each panel contains a BBCodeView. When I copy a BBCodeView with Code: Copy Dim bmp As B4XBitmap = BBCodeViewM.mBase.Snapshot fx.Clipboard.SetImage(bmp) I get only the visible part togehter with the vertical scrollbar. How can I get the image and only the image of the whole BBCodeView. Is there perhaps a way to capture the entire sv to bmp? Thanks for your help, john m.
My app is a CLV expandable list where each panel contains a BBCodeView. When I copy a BBCodeView with Code: Copy Dim bmp As B4XBitmap = BBCodeViewM.mBase.Snapshot fx.Clipboard.SetImage(bmp) I get only the visible part togehter with the vertical scrollbar. How can I get the image and only the image of the whole BBCodeView. Is there perhaps a way to capture the entire sv to bmp? Thanks for your help, john m.
johnmie Active Member Licensed User Longtime User Jul 2, 2022 #2 SOLVED just found the solution: Code: Copy Dim bmp As B4XBitmap = clv1.sv.Snapshot.Crop(0,40,580,851) where 40 is the height of the clickable title bar 580 the view width minus the vertical scrollbar 881 the true panel display height. It was that simple. cheers, john m. Upvote 0
SOLVED just found the solution: Code: Copy Dim bmp As B4XBitmap = clv1.sv.Snapshot.Crop(0,40,580,851) where 40 is the height of the clickable title bar 580 the view width minus the vertical scrollbar 881 the true panel display height. It was that simple. cheers, john m.
Erel B4X founder Staff member Licensed User Longtime User Jul 3, 2022 #3 Tip: make sure that the lazy loading option is disabled in the designer. Upvote 0
johnmie Active Member Licensed User Longtime User Jul 3, 2022 #4 Erel said: Tip: make sure that the lazy loading option is disabled in the designer. Click to expand... Thank you, Erel but how do I do that? could not find where in the designer for the CustomListView or in BBListItem to intervene. Or should I load a regular (not pre-optimized) listview instead? Upvote 0
Erel said: Tip: make sure that the lazy loading option is disabled in the designer. Click to expand... Thank you, Erel but how do I do that? could not find where in the designer for the CustomListView or in BBListItem to intervene. Or should I load a regular (not pre-optimized) listview instead?
Erel B4X founder Staff member Licensed User Longtime User Jul 3, 2022 #5 It is in BBCodeView properties. It is not relevant if you are using BBListItem. Upvote 0
johnmie Active Member Licensed User Longtime User Jul 3, 2022 #6 Erel said: It is in BBCodeView properties. It is not relevant if you are using BBListItem. Click to expand... But line "Paragraph = mTextEngine.PrepareForLazyDrawing(Runs, Style, StubScrollView)" in BBListItem.bas under "Redraw"? Upvote 0
Erel said: It is in BBCodeView properties. It is not relevant if you are using BBListItem. Click to expand... But line "Paragraph = mTextEngine.PrepareForLazyDrawing(Runs, Style, StubScrollView)" in BBListItem.bas under "Redraw"?
Erel B4X founder Staff member Licensed User Longtime User Jul 3, 2022 #7 It depends on how exactly you are using BBListItem. Make a test. Add several lengthy items and see whether the screenshot includes all text. Upvote 0
It depends on how exactly you are using BBListItem. Make a test. Add several lengthy items and see whether the screenshot includes all text.
johnmie Active Member Licensed User Longtime User Jul 3, 2022 #8 Dear Erel, thank you for taking the time for this. Make a test. Click to expand... My program loads the attached *.bblst (text) file where lines beginning with "$¶" or "$>¶" are the separators that become the clickable headers, the rest in between is regular BBcode for the panels. All [url images for button links and bitmaps for table lines are already in a tempPath. When I scroll down or enlarge the height of the window (over two monitors) everything is there, but not everybody has two screens. Should I perhaps create a new panel in the background with the exact size? Attachments help_en.zip help_en.zip 8.1 KB · Views: 390 Upvote 0
Dear Erel, thank you for taking the time for this. Make a test. Click to expand... My program loads the attached *.bblst (text) file where lines beginning with "$¶" or "$>¶" are the separators that become the clickable headers, the rest in between is regular BBcode for the panels. All [url images for button links and bitmaps for table lines are already in a tempPath. When I scroll down or enlarge the height of the window (over two monitors) everything is there, but not everybody has two screens. Should I perhaps create a new panel in the background with the exact size?
Erel B4X founder Staff member Licensed User Longtime User Jul 4, 2022 #9 What I meant is that you should test it with enough text to make part of the text outside of the screen. If it works then everything is fine. Upvote 0
What I meant is that you should test it with enough text to make part of the text outside of the screen. If it works then everything is fine.
johnmie Active Member Licensed User Longtime User Jul 4, 2022 #10 In that sense everything is fine, the attached pix shows the same panel as in post 1, but in enlarged window. But I still don't know how to copy or print this without having to dramatically enlarge the window. Upvote 0
In that sense everything is fine, the attached pix shows the same panel as in post 1, but in enlarged window. But I still don't know how to copy or print this without having to dramatically enlarge the window.
Erel B4X founder Staff member Licensed User Longtime User Jul 4, 2022 #11 There are all kinds of ways. One of them is to add an invisible regular BBCodeView and disable its lazy loading feature. Set its text when you are ready to print. and get the image with BBCodeView.ForegroundImageView.GetBitmap. Upvote 0
There are all kinds of ways. One of them is to add an invisible regular BBCodeView and disable its lazy loading feature. Set its text when you are ready to print. and get the image with BBCodeView.ForegroundImageView.GetBitmap.
johnmie Active Member Licensed User Longtime User Jul 6, 2022 #12 Thank you Erel very much, it alsmost works now except the background is always black and only the text in color is visible and no pictures. I did exactly as you said Code: Copy BBCodeView1.TextEngine = TextEngine BBCodeView1.Text = Qtext(expandable.lastIndex) Dim bmx As B4XBitmap = BBCodeView1.ForegroundImageView.GetBitmap fx.Clipboard.SetImage(bmx) Where Private BBCodeView1 in class globals, in Designer in parent = Form main, background white, lazy loading is disabled. What have I missed or goofed-up? Should the BBCodeView1 be inside a separate pane which would be resized accordingly? And can this be larger than the form? Upvote 0
Thank you Erel very much, it alsmost works now except the background is always black and only the text in color is visible and no pictures. I did exactly as you said Code: Copy BBCodeView1.TextEngine = TextEngine BBCodeView1.Text = Qtext(expandable.lastIndex) Dim bmx As B4XBitmap = BBCodeView1.ForegroundImageView.GetBitmap fx.Clipboard.SetImage(bmx) Where Private BBCodeView1 in class globals, in Designer in parent = Form main, background white, lazy loading is disabled. What have I missed or goofed-up? Should the BBCodeView1 be inside a separate pane which would be resized accordingly? And can this be larger than the form?
Erel B4X founder Staff member Licensed User Longtime User Jul 7, 2022 #13 The background is black because the image view background is transparent. Taking a screenshot of the added views is more complicated. If you need it then it will be simpler to call something like BBCodeView1.ForegroundImageView.Parent.Snapshot. Upvote 0
The background is black because the image view background is transparent. Taking a screenshot of the added views is more complicated. If you need it then it will be simpler to call something like BBCodeView1.ForegroundImageView.Parent.Snapshot.
johnmie Active Member Licensed User Longtime User Jul 7, 2022 #14 Heureka IT WORKS. phantastic! Thank you very much Erel, you deserve an excellent free lunch! cheers, john m. Upvote 0
Heureka IT WORKS. phantastic! Thank you very much Erel, you deserve an excellent free lunch! cheers, john m.