B4J Question Snapshot returns a bitmap that's 1 pixel bigger than the size of the node it captured.

TelKel81

Active Member
Licensed User
Always, no matter the size of the node (an Imageview. Also tried with a Pane).

My main issue is that this alters "the original" (via resizing by 1 pixel?) and also offsets it's center.

I wish I could use Imageview.GetImage but I can't because contrary to Imageview.Snapshot, Imageview.GetImage doesn't capture the output of JavaFx's effects (via setEffect method).

Any suggestion on how to solve this issue ?
 

TelKel81

Active Member
Licensed User
Problem solved. The bounds of the node's parent weren't whole numbers. That's what caused my blurry/offset snapshots.

Of note, I also discovered that project attribute #MainFormWidth: X doesn't necessarily equals X.
In my case :
#MainFormWidth: 800
Log(Form1.Width) -> 800.5565185546875
 
Upvote 1
Top