Comments (16)
I noticed the bug is here:
procedure TCustomBGRAVirtualScreen.BGRASetSize(AWidth, AHeight: integer);
begin
if (FBGRA <> nil) {and ((AWidth <> FBGRA.Width) or (AHeight <> FBGRA.Height))} then
begin
FBGRA.SetSize(AWidth, AHeight);
RedrawBitmapContent;
FDiscardedRect := EmptyRect;
end;
end;
and ((AWidth <> FBGRA.Width) or (AHeight <> FBGRA.Height))
Commenting that code works. Still waiting for your input.
from bgracontrols.
Hi, seems that BGRAVirtualScreen don't discard bitmap if the width of the control doesn't change... even if I want it to discard.
Check \bgracontrols\test\test_bgravirtualscreen_blurHi. I don't see this example in the repository.
In dev-bgracontrols branch.
from bgracontrols.
Hi Leandro,
It is on purpose that BGRASetSize
function doesn't change the content if the size is the same. Consider a button, unless it is resized, most of the time, we don't want to redraw it.
So please don't change BGRASetSize
function this way. Are there any other approach, like calling DiscardBitmap
function in the OnResize
event of the form?
Regards
from bgracontrols.
Thanks, it works fine on latest Lazarus.
from bgracontrols.
Instructions: open the demo, and resize the window, the bottom virtual screen is resized and repainted correctly, but the static bgravirtualscreen at the top left are not repainted.
from bgracontrols.
Hi, seems that BGRAVirtualScreen don't discard bitmap if the width of the control doesn't change... even if I want it to discard.
Check \bgracontrols\test\test_bgravirtualscreen_blur
Hi. I don't see this example in the repository.
from bgracontrols.
Hi, but you've tested the demo? It has DiscardBitmap on resize.
procedure TForm1.FormResize(Sender: TObject);
var
i: integer;
vs: TBGRAVirtualScreen;
begin
for i:=0 to Self.ControlCount-1 do
begin
if (Self.Controls[i] is TBGRAVirtualScreen) then
begin
vs := (Self.Controls[i] as TBGRAVirtualScreen);
vs.DiscardBitmap;
end;
end;
end;
from bgracontrols.
Ah ok, there was a misunderstanding. I thought you expected it to discard automatically on resize.
I haven't tested the project yet. From the code you've cited, it seems there is a call to DiscardBitmap that normally would redraw the content.
I will dig deeper into it.
from bgracontrols.
The discard code on resize was wrong. I've fixed it, still buggy... now the bug is when resizing it don't update the bitmap, only when the resize is done..
from bgracontrols.
Hi Leandro,
Indeed, I came to the same conclusion, that it was cycling the main controls of the form, whereas the panels you're considering are inside the first virtual screen.
After that, I don't notice the problem of delayed update you're mentionning.
Regards
from bgracontrols.
Maybe because I'm using Windows. Or because I'm using Lazarus 2.2.6
from bgracontrols.
This is a video showing the problem, notice that the top left virtual screen are not updated until I release the mouse:
https://github.com/bgrabitmap/bgracontrols/assets/4131395/146aac96-1d5d-41c2-9c86-309574dd206b
from bgracontrols.
Indeed, I can see the fixed panels are not update.
I tried it on Windows 11 and Lazarus 3.0. It is laggy but updates all panels.
from bgracontrols.
Maybe we can add a boolean that triggers the update without checking width and height like I showed in previous comments.
Something like "optimized Discard" if set to true is like
If fbgra <> nil and optimized Discard and width and height...
By default is true. And if set to false it will discard anyways no matter the width and height.
That makes it run smoothly.
from bgracontrols.
Oh I see, I will try on latest lazarus first.
from bgracontrols.
Glad it is all well for you
from bgracontrols.
Related Issues (20)
- TBCPanel always disable ParentBackground HOT 6
- Scale fonts and borders
- BGRASVGIMageList memory leak HOT 2
- New update BGRA bug HOT 1
- TColorSpeedButton, TBGRASpeedButton and TBGRAResizeSpeedButton don't print images from ImageList
- BGRASVGImageList saves different binary format per platform (patch available) HOT 15
- Memory leak version Version 8 ARM64 bit HOT 15
- unitbgraimagemanipulationdemo.pas does not compile HOT 3
- Failure to compile BGRABitmap with FPC 3.3.1 HOT 1
- TabOrder for BCMaterialEdit and other wont work
- Initial background of Themed Gauge and Clock mixed up pixels
- Forgetting to set a PopupMenu causes runtime exception HOT 1
- TBCComboBox in macOS ShowModal issues HOT 5
- Cannot compile in lazarus fixes, fpc fixes (BGRAKnob) HOT 1
- Update readme HOT 13
- TBGRAImageList Draw method not virtual HOT 1
- TBCFluentProgressRing component doesn't display well in Linux
- BGRAImageManipulation dividing by zero HOT 2
- Please simplify TBGRASVGTheme HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bgracontrols.