leviathan_0
leviathan_0
CC#
Created by leviathan_0 on 3/18/2023 in #help
Simple 2D graphics in C#
I want to make a 2D physics engine (mostly for learning), and I need a way to visualise the simulations I run. I want something that is simple to use, lightweight and (ideally) cross-platform. I need it to provide a direct way to open a window and draw basic shapes onto a canvas (circles/ellipses, polygons), providing me with full control over aspects like colour and line width. In brief, I'm looking for something like Processing but for C#.
7 replies
CC#
Created by leviathan_0 on 10/22/2022 in #help
Rendering and updating a colormap
I'm developing a library related to real-time image generation. To test it, I'm trying to make an app that can convert a Color[,] into an image and display it, updating at 60 fps (Color is a class with 3 float fields). Ideally, I'd want my code to be like this:
DynamicImage dynImg = new DynamicImage();
every 1/60 seconds do{
Color[,] colormap = dynImg.getImgAtTime(time);
imageDisplay.setImage(colormap.convertToImage());
}
DynamicImage dynImg = new DynamicImage();
every 1/60 seconds do{
Color[,] colormap = dynImg.getImgAtTime(time);
imageDisplay.setImage(colormap.convertToImage());
}
where imageDisplay would probably be a PictureBox in a WPF app (with which I have no experience at all). (This is of course pseudocode) Any help is greatly appreciated.
113 replies