From: <no...@tc...> - 2024-08-09 17:03:22
|
Automated mail by fx, on behalf of no...@tc... Ticket Change [84a571f32e7667da14d101ae02999ec94c4071dc4f8f218832732a297c9b514f] [XGetImage fails on Mac using Tk 9.0.b3] By marc_culler For Tk On 2024-08-09T17:01:58.268 Details https://core.tcl-lang.org/tk/tinfo?name=84a571f32e7667da14d101ae02999ec94c4071dc4f8f218832732a297c9b514f Ticket https://core.tcl-lang.org/tk/tktview/b7d813f008173e9760fe13a07749dc3f513faf41 Changed Fields comment: The Img extension uses XGetImage for format option "-window" to get a "screenshot" of a widget. This fails using Tk 9.0.b3 on ac. Previous versions (8.6, 8.7, 9.0.b2) worked fine. It also works fine using Tk9.0.b3 on Windows or Linux. The call of XGetImage returns NULL, because the CGImageRef returned by function CreateCGImageFromDOrawableRect only has 3 samples per pixel, but is checked for having 4. This new behaviour seems to be related to changes at the beginning of function CreateCGImageFromDrawableRect, where a CGContextRef is created. Attached test script derived from the Img test suite demonstrates the error. icomment: I am not sure whether the Img extension is expecting that XGetImage would somehow be expected to know what the entire Canvas scrollregion looks like, even though parts of it had never been drawn to the scteen. With the old implementation which would create a new CGImage and ask the canvas to redraw itself using a graphics context for that CGImage, it would be easier to imagine how to create an image of the entire Canvas. But I don't know how XGetImage would even be able to find the dimensions of the scrollregion, since I don't think it is supposed to have any knowledge of the inner workings of the window it is getting an image from. I think I am pretty far from understanding how the Img extension implements the -format window -data $canv options that you are using in your script. I will need an explanation. login: marc_culler username: Marc Culler ------------------------------------------------------------ See Tcl/Tk development @ http://core.tcl-lang.org/ ------------------------------------------------------------ |