Drawable control clear contents

54 views
Skip to first unread message

Stefano Gardini

unread,
Feb 10, 2016, 9:54:36 AM2/10/16
to Eto.Forms
I create a custom control inherited from Drawable. I draw rectangles (drawing test) and I wait few seconds: control clear area. In events Paint and SizeChanged I re-draw my rectangles but after few second ... voilà it clear itself.
VS 2015 on Windows 7.
Solutions? Ideas?

Eng. Stefano Gardini

curtis

unread,
Feb 13, 2016, 2:08:09 PM2/13/16
to Eto.Forms
Hi Stefano,

I'm not sure I can follow what your problem is without seeing any code.  I haven't heard of or run into this particular problem before.

Is your code available somewhere or can you create a simple repro of the problem?  Also, what Eto platform are you running?  Wpf, WinForms, D2D?

Thanks!
Curtis.

Stefano Gardini

unread,
Feb 14, 2016, 5:08:29 AM2/14/16
to eto-...@googlegroups.com
Thanks for your help.
I created a private repo to bitbucket ad I set your email permissions to read/write

The project in intended to run on WinForms and Xamarin.Mac
The repo is for WinForm version (and the problem is in this version)
In Mac (OSX ElCapitain) I have another problem: when I run Draw method, CreateGraphic method return a NullException.

Hava a nice day.

Eng. Stefano Gardini


Stefano Gardini
---
Amica 10
by CIR 2000
Software gestionale per la piccola impresa italiana


Telefono 0544-406034 (8:30-12:30 e 14:30-17:30)
Skype bswassistenza
Fax 0544 1960224


--
You received this message because you are subscribed to a topic in the Google Groups "Eto.Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eto-forms/Bxhavgy-Y8k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eto-forms+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eto-forms/c2cfd86e-ba37-4520-9211-8c74714cb86d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

curtis

unread,
Feb 14, 2016, 5:16:35 AM2/14/16
to Eto.Forms
Hi Stefano,

I see your problem, here.

You need to use the PaintEventArgs.Graphics property you are given in the Paint event here.

the Drawable.CreateGraphics() is only useful when you want to paint directly to the screen outside of the paint event, and not retain its state (which makes sense with the problem you're running into).

Hope this helps!
Curtis.


On Sunday, February 14, 2016 at 2:08:29 AM UTC-8, Stefano Gardini wrote:
Thanks for your help.
I created a private repo to bitbucket ad I set your email permissions to read/write

The project in intended to run on WinForms and Xamarin.Mac
The repo is for WinForm version (and the problem is in this version)
In Mac (OSX ElCapitain) I have another problem: when I run Draw method, CreateGraphic method return a NullException.

Hava a nice day.

Eng. Stefano Gardini


Stefano Gardini
---
Amica 10
by CIR 2000
Software gestionale per la piccola impresa italiana


Telefono 0544-406034 (8:30-12:30 e 14:30-17:30)
Skype bswassistenza
Fax 0544 1960224


Stefano Gardini

unread,
Feb 14, 2016, 5:58:56 AM2/14/16
to eto-...@googlegroups.com
Thanks for yor help. I solved.

Eng. Stefano Gardini

Stefano Gardini
---
Amica 10
by CIR 2000
Software gestionale per la piccola impresa italiana


Telefono 0544-406034 (8:30-12:30 e 14:30-17:30)
Skype bswassistenza
Fax 0544 1960224


2016-02-14 11:16 GMT+01:00 curtis <curtis....@gmail.com>:
Hi Stefano,

I see your problem, here.

You need to use the PaintEventArgs.Graphics property you are given in the Paint event here.

the Drawable.CreateGraphics() is only useful when you want to paint directly to the screen outside of the paint event, and not retain its state (which makes sense with the problem you're running into).

Hope this helps!
Curtis.


On Sunday, February 14, 2016 at 2:08:29 AM UTC-8, Stefano Gardini wrote:
Thanks for your help.
I created a private repo to bitbucket ad I set your email permissions to read/write

--
You received this message because you are subscribed to a topic in the Google Groups "Eto.Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eto-forms/Bxhavgy-Y8k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eto-forms+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages