Click here to Skip to main content
15,391,068 members
Home / Discussions / C#
   

C#

 
GeneralRe: Drawing with c# Pin
Richard Deeming23-Jun-22 0:42
mveRichard Deeming23-Jun-22 0:42 
AnswerRe: Drawing with c# Pin
Gerry Schmitz23-Jun-22 3:09
mveGerry Schmitz23-Jun-22 3:09 
AnswerRe: Drawing with c# Pin
OriginalGriff23-Jun-22 3:59
mveOriginalGriff23-Jun-22 3:59 
AnswerRe: Drawing with c# Pin
Member 1557095223-Jun-22 21:16
MemberMember 1557095223-Jun-22 21:16 
GeneralRe: Drawing with c# Pin
Richard Deeming23-Jun-22 22:24
mveRichard Deeming23-Jun-22 22:24 
GeneralRe: Drawing with c# Pin
Member 1557095223-Jun-22 23:20
MemberMember 1557095223-Jun-22 23:20 
GeneralRe: Drawing with c# Pin
Victor Nijegorodov24-Jun-22 5:54
MemberVictor Nijegorodov24-Jun-22 5:54 
GeneralRe: Drawing with c# Pin
Dave Kreskowiak24-Jun-22 5:58
mveDave Kreskowiak24-Jun-22 5:58 
Forget the drawing for now.

You have to create a parser for the file. That parser is going to create an object "graph", which is the list of commands your drawing code is going to interpret to tell it what/how to draw.

You have to ask yourself what does each line in the file mean and convert those items to data structures. For example, the parser is going to com across a line with "Line" in it. To create a Line structure, you need to know the X and Y coordinates of both endpoints of the line, so you need four values. The parser should expect those four values on the lines after "Line". Read those values and place them into the structure. Once the values are filled in, add the structure to a List that holds those structures. This list is what the drawing code is going to need to tell it what to do.

What odes the "False" and the "0" after it mean? Your parser is going to have to deal with those too, as appropriate.


Why do you need to do this? Because of the way Windows works. Windows calls your app to tell it to draw itself, and your window needs the data to redraw itself over and over again. For example, if another window is dragged over the top of your window, Windows will tell your app to redraw itself repeatedly, as the other window is being dragged over the top of yours.

GeneralRe: Drawing with c# Pin
trønderen24-Jun-22 17:02
Membertrønderen24-Jun-22 17:02 
QuestionSimple Paint app in winforms Pin
Aafaan_Jii20-Jun-22 23:19
MemberAafaan_Jii20-Jun-22 23:19 
AnswerRe: Simple Paint app in winforms Pin
OriginalGriff20-Jun-22 23:40
mveOriginalGriff20-Jun-22 23:40 
AnswerRe: Simple Paint app in winforms Pin
Pete O'Hanlon21-Jun-22 2:18
mvaPete O'Hanlon21-Jun-22 2:18 
AnswerRe: Simple Paint app in winforms Pin
Dave Kreskowiak21-Jun-22 4:39
mveDave Kreskowiak21-Jun-22 4:39 
AnswerRe: Simple Paint app in winforms Pin
Gerry Schmitz21-Jun-22 4:45
mveGerry Schmitz21-Jun-22 4:45 
QuestionHTML Input Controls Value Pin
Member 1431490219-Jun-22 18:46
MemberMember 1431490219-Jun-22 18:46 
AnswerRe: HTML Input Controls Value Pin
OriginalGriff19-Jun-22 19:32
mveOriginalGriff19-Jun-22 19:32 
GeneralRe: HTML Input Controls Value Pin
Member 1431490219-Jun-22 19:47
MemberMember 1431490219-Jun-22 19:47 
GeneralRe: HTML Input Controls Value Pin
Richard Deeming19-Jun-22 21:38
mveRichard Deeming19-Jun-22 21:38 
GeneralRe: HTML Input Controls Value Pin
OriginalGriff19-Jun-22 21:51
mveOriginalGriff19-Jun-22 21:51 
GeneralRe: HTML Input Controls Value Pin
Dave Kreskowiak20-Jun-22 3:49
mveDave Kreskowiak20-Jun-22 3:49 
GeneralRe: HTML Input Controls Value Pin
Member 1431490220-Jun-22 3:56
MemberMember 1431490220-Jun-22 3:56 
GeneralRe: HTML Input Controls Value Pin
Dave Kreskowiak20-Jun-22 3:57
mveDave Kreskowiak20-Jun-22 3:57 
GeneralRe: HTML Input Controls Value Pin
Member 1431490220-Jun-22 3:58
MemberMember 1431490220-Jun-22 3:58 
GeneralRe: HTML Input Controls Value Pin
Dave Kreskowiak20-Jun-22 4:00
mveDave Kreskowiak20-Jun-22 4:00 
GeneralRe: HTML Input Controls Value Pin
Mycroft Holmes20-Jun-22 12:31
professionalMycroft Holmes20-Jun-22 12:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.