You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Graphics32 TColorPickerGTK不支持VCL Styles,如何获取窗体底层画布?

问题:TColorPickerGTK 适配VCL Styles 的画布获取问题

我正在使用Graphics32的TColorPickerGTK组件,可惜它不支持VCL Styles。我先试了一个方案:在PaintColorPicker()方法里清除FBuffer,代码如下:

FBuffer.Clear( Color32( StyleServices.GetStyleColor( scWindow ) ) );

这个方法在非纹理样式下表现挺好,但遇到Glossy、Jet这类带纹理的样式时,效果就完全达不到预期了。

后来我换了个思路:打算在Create()方法里先复制控件下方的位图,之后在PaintColorPicker()方法里重新绘制它,目前写的代码是这样的:

ABitmap := TBitmap32.Create(); 
ABitmap.SetSize( Width, Height ); 
ARect1 := Rect( 0, 0, Width, Height ); 
ABitmap.Canvas.CopyRect( ARect1, {No canvas object}, ARect1 );

现在我卡在这里了——怎么获取窗体的底层画布,让CopyRect能正常工作呢?

内容的提问来源于stack exchange,提问作者GrooverMD

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:04:47