相关疑难解决方法(0)

如何绘制图像的一部分?

我有一个普通的Bitmap加载了PNGImage.以下代码显示整个图像; 但我要找的是像下面的示例一样显示.我基本上想要减少它将被绘制的虚拟"位置".请注意,我不能仅仅因为有人问我可以枚举的原因来调整PaintBox的大小.我想我必须使用Rects和/或一些复制功能,但我自己也搞不清楚.有谁知道怎么办?

procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
    PaintBox1.Canvas.Brush.Color := clBlack;
    PaintBox1.Brush.Style := bsSolid;
    PaintBox1.Canvas.FillRect(GameWindow.Screen.ClientRect);
    PaintBox1.Canvas.Draw(0, 0, FBitmap, FOpacity);
end;
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

delphi canvas bitmap delphi-xe3

4
推荐指数
1
解决办法
2066
查看次数

标签 统计

bitmap ×1

canvas ×1

delphi ×1

delphi-xe3 ×1