我有一个普通的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)
