The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: SepulRise on May 04, 2005, 06:51:42 PM

Title: Help with assembler
Post by: SepulRise on May 04, 2005, 06:51:42 PM
Hi.

How can i make a program in assembler to draw a line with angles, etc...

Is Urgent

Thanks
Title: Re: Help with assembler
Post by: pbrennick on May 04, 2005, 07:09:30 PM
SepulRise,

According to the API, this might be close to what you want, there are othere search results you can scope out:

The following would be used by BeginPaint and then you would issue an EndPaint.  The RECT parameter can be set to do what you need.
Quote
The PAINTSTRUCT structure contains information for an application. This information can be used to paint the client area of a window owned by that application.

typedef struct tagPAINTSTRUCT { // ps 
    HDC  hdc;
    BOOL fErase;
    RECT rcPaint;
    BOOL fRestore;
    BOOL fIncUpdate;
    BYTE rgbReserved[32];
} PAINTSTRUCT;


Members

hdc

Identifies the display DC to be used for painting.

fErase

Specifies whether the background must be erased. This value is nonzero if the application should erase the background. The application is responsible for erasing the background if a window class is created without a background brush. For more information, see the description of the hbrBackground member of the WNDCLASS structure.

rcPaint

Specifies a RECT structure that specifies the upper left and lower right corners of the rectangle in which the painting is requested.

fRestore

Reserved; used internally by Windows.

fIncUpdate

Reserved; used internally by Windows.

rgbReserved

Reserved; used internally by Windows.

hth:
Paul
Title: Re: Help with assembler
Post by: AeroASM on May 04, 2005, 08:08:12 PM
To draw the line, use BeginPaint,PolyLine,EndPaint

To work out the line points from the angles, use trigonometry with the FPU.
raymond's tutorial: http://www.website.masmforum.com/tutorials/fptute/
Title: Re: Help with assembler
Post by: QvasiModo on May 05, 2005, 08:58:47 PM
Sounds like homework. Is it for DOS or Windows?
Title: Re: Help with assembler
Post by: Bieb on May 05, 2005, 10:30:32 PM
Sounds very much like homework.  Anyhow, if you don't know assembler, you're not going to get this done very quickly.  It took me months to get used to it.  Anyhow, if you need to learn the basics, check out Iczelion's tutorials, at win32asm.cjb.net.
Title: Re: Help with assembler
Post by: pbrennick on May 06, 2005, 03:31:51 AM
I hope it isn't homework, this forum is starting to give me a pain with all these homework requests!  Anyway, to be safe, I only point to the API, I am not willing to surrender code examples to unknown users.

Paul