Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi 水平翻转TPath形状数据_Delphi_Firemonkey_Delphi 10.3 Rio - Fatal编程技术网

Delphi 水平翻转TPath形状数据

Delphi 水平翻转TPath形状数据,delphi,firemonkey,delphi-10.3-rio,Delphi,Firemonkey,Delphi 10.3 Rio,如何翻转TPath形状组件数据?我已经从SVG图像加载了路径数据,但是形状被翻转了,我想水平翻转它 我尝试过使用Canvas.CopyRec方法,但我认为这是一种VCL方法 var src, dest: TRect; begin dest:=bounds(0, 0, image1.Picture.Width, image1.Picture.Height); //src:=rect(0, image1.Picture.Height-1, image1.Picture.Width-1, 0)

如何翻转TPath形状组件数据?我已经从SVG图像加载了路径数据,但是形状被翻转了,我想水平翻转它

我尝试过使用
Canvas.CopyRec
方法,但我认为这是一种VCL方法

var src, dest: TRect;
begin
  dest:=bounds(0, 0, image1.Picture.Width, image1.Picture.Height);
  //src:=rect(0, image1.Picture.Height-1, image1.Picture.Width-1, 0); // Vertical flip
  //src:=rect(image1.Picture.Width-1, 0, 0, image1.Picture.Height-1); // Horizontal 
  flip
  src:=rect(image1.Picture.Width-1, image1.Picture.Height-1, 0, 0); // Both flip
  image1.Picture.Bitmap.Canvas.CopyRect(dest, image1.Picture.Bitmap.Canvas, src);

我正在使用Firemonkey和Delphi 10.3.2

一个简单的水平翻转解决方案可以通过组件TPath的属性Scale.X中的负值来实现

对于垂直翻转,使用路径1.Scale.Y:=-1

Path1.Scale.X := -1;