我正在尝试以从右到左的方向绘制类的ttGlyphClosed
元素(就像什么时候一样)。我有一个问题,我不知道如何使我的屏幕外位图透明。位图的背景总是白色的。Explorer::Treeview
BiDiMode
bdLeftToRight
我正在使用以下代码来镜像图像:
procedure TForm5.FormPaint(Sender: TObject);
var
bm: TBitmap;
ARect: TRect;
Details: TThemedElementDetails;
begin
if ExplorerTreeviewhTheme = 0 then
ExplorerTreeviewhTheme := OpenThemeData(0, 'Explorer::Treeview');
ARect := Rect(20, 20, 40, 40);
Details := ThemeServices.GetElementDetails(ttGlyphClosed);
DrawThemeBackground(ExplorerTreeviewhTheme, Canvas.Handle,
Details.Part, Details.State, ARect, nil); //Ok
bm := TBitmap.Create;
try
bm.Width := 20;
bm.Height := 20;
ARect := Rect(00, 00, 20, 20);
DrawThemeBackground(ExplorerTreeviewhTheme, bm.Canvas.Handle,
Details.Part, Details.State, ARect, nil);
// rendered result has white background
Canvas.Draw(60, 10, bm);
// rendered result is mirrored but has also white background
StretchBlt(Canvas.Handle, 100, 10, -20, 20, bm.Canvas.Handle, 0, 0, 20, 20, SRCCOPY);
finally
bm.Free;
end;
end;
问题是如何镜像DrawThemeBackground
函数绘制的元素(用于 RTL 读取)或如何使用此函数进行 RTL(从右到左)渲染?