DelphiFMX4Python icon indicating copy to clipboard operation
DelphiFMX4Python copied to clipboard

Image canvas BeginScene problem

Open Halex10000 opened this issue 3 years ago • 4 comments

Hi, i tried drawing some graphics on an Image component without success. Calling BeginScene method returns me an error: Type Error: BeginScene called with invalid arguments. Error: Colud not find a method with compatible arguments.

Below is the code called on a onclick method of the form. The Image component is named ImageCanvas

def do_button_click(self, sender): self.ImageCanvas.Bitmap.LoadFromFile('canvas.png') myrect = RectF(50, 30, 150, 200) canvas = self.ImageCanvas.Bitmap.Canvas canvas.BeginScene() canvas.Stroke.Kind = 1; canvas.Stroke.Color = 0xFF00FF00; canvas.StrokeThickness = 4; canvas.DrawEllipse(myrect, 255); canvas.EndScene()

I tried several arguments without any success

Any suggestion?

Thank you

Regards

Alessandro

Halex10000 avatar Jun 03 '22 12:06 Halex10000

Hi @Halex10000,

like described in the following documentation, two parameters are expected as part of the FMX.Graphics.TCanvas.BeginScene. Check it out in the link below: https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Graphics.TCanvas.BeginScene

If you don't want to input this parameters, you can provide the None type.

Let me know if it works for you.

lmbelo avatar Jun 03 '22 12:06 lmbelo

Hi Imbelo, thank you for the prompt answer.

I tried with canvas.BeginScene(None, None) but I received the same error as before.

Thanks

Alessandro

Halex10000 avatar Jun 03 '22 12:06 Halex10000

@Halex10000,

I will try to replicate this issue and bring you further details soon.

lmbelo avatar Jun 03 '22 12:06 lmbelo

We reproduced your issue. We shall try to provide the fix soon.

Priyatham10 avatar Aug 24 '22 08:08 Priyatham10