Forum > BGRABitmap and LazPaint

Using TBgraBitmap for screenshot - only one image results

<< < (2/2)

circular:
This could be a bug of BGRABitmap. Though I checked the code and the function InvalidateBitmap seems to be called so normally the Bitmap object should be rebuilt.

What if you call FMyCapture.InvalidateBitmap before calling Clipboard.Assign?

Or if you do FMyCapture.SetSize(0,0) before calling FMyCapture.TakeScreenShot ?

Regards

Manlio:
I encountered similar problems with TBGRABitmap in the past, and I suspect that there may be some kind of Canvas locking/unlocking mechanism involved, or some caching mechanism, or something along those lines, that is implicitly invoked by certain operations, and which requires some action (which I could never figure out) in order for the object to be completely reset.

And whenever I could not figure it out, I resorted to creating/freeing a new object every time I need it, and stopped worrying about it...

If however someone more knowledgeable can tell us how to completely reset the object, it will be very appreciated :)

winni:
Hi!
This will rebuild the TBGRAbitmap:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var bmp: TBGRAbitmap;...bmp.InvalidateBitmap... 
Winni

AlexTP:
That method is mentioned here
https://wiki.freepascal.org/BGRABitmap#Direct_access_to_pixels
But it's deep inside the wiki text and not visible.

circular:
Well normally you shouldn't have to call InvalidateBitmap unless you write direct access to pixels. But maybe in this case it is not already called for some reason.

Navigation

[0] Message Index

[*] Previous page

Go to full version