Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Trouble displaying an Image being drawn with the Drawing API #837

Open
garymooney opened this issue Jun 7, 2018 · 0 comments
Open

Trouble displaying an Image being drawn with the Drawing API #837

garymooney opened this issue Jun 7, 2018 · 0 comments

Comments

@garymooney
Copy link

Hi,

I'm very new to Xwt and am trying to procedurally generate and draw an image on a Gtk Window.

My code is as follows

Application.Initialize(ToolkitType.Gtk);
var mainWindow = new Window();
mainWindow.Title = "Xwt Demo Application";
mainWindow.Width = 500;
mainWindow.Height = 400;

Table vbox = new Table();
vbox.Add(new ImageView(new CustomImage()), 0, 0);
            
mainWindow.Content = vbox;
mainWindow.Show();
Application.Run();

mainWindow.Dispose();
Application.Dispose();

The CustomImage class overrides the OnDraw(Context, Rectangle) method with

ctx.Rectangle(new Rectangle(0, 0, 50, 50));
ctx.Arc(25, 25, 25, 0, 360);
ctx.SetColor(Colors.Black);
ctx.Stroke();

I see the window but no image inside. Using the Wpf toolkit type displays the image fine.

I'm finding Xwt to be quite hard to learn due to their being no tutorials or API documentation (at least from my search). Are there any recommendations of reference material you might have?

Thanks for any help,

Gary

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant