How to write a C program to draw a line in visual studio 2019?

Anonymous
2020-08-17T16:03:39.447+00:00

I searched a lot over internet but could not find a satisfying answer. I tried all tricks but it did not work.

Developer technologies C++
0 comments No comments
{count} votes

Accepted answer
  1. Sean Liming 4,766 Reputation points Volunteer Moderator
    2020-08-17T16:20:59.357+00:00

    A graphics library is needed. The old way in C was to use Turbo C and the graphics.h library that supported drawing.For Visual Studio, there is Win32, C++, and GDI as this youtube video points out: https://www.youtube.com/watch?v=WmSuwojt3nw, but it is not C. GTK and IUP are a couple of graphical libraries that work with C.

    Regards,

    Sean Liming

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Castorix31 90,521 Reputation points
    2020-08-17T16:35:16.603+00:00

    There are several ways (GDI, GDI+, Direct2D, ...)

    In GDI, it can be done with : LineTo function,
    in WM_PAINT of a window or control

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.