a silly little question.

i want to use this:

BOOL PlgBlt(

HDC hdcDest, // handle of destination device context
CONST POINT * lpPoint, // vertices of destination parallelogram
HDC hdcSrc, // handle of source device context
int nXSrc, // x-coord. of upper-left corner of source rect.
int nYSrc, // y-coord. of upper-left corner of source rect.
int nWidth, // width of source rectangle
int nHeight, // height of source rectangle
HBITMAP hbmMask, // handle of bitmask
int xMask, // x-coord. of upper-left corner of bitmask rect.
int yMask // y-coord. of upper-left corner of bitmask rect.


Identifies the destination device context.


Points to an array of three points in logical space that identify three corners of the destination parallelogram. The upper-left corner of the source rectangle is mapped to the first point in this array, the upper-right corner to the second point in this array, and the lower-left corner to the third point. The lower-right corner of the source rectangle is mapped to the implicit fourth point in the parallelogram.

An array of 3 points you say? hmmmm... syntax has me stumped here.

i've probably used 1,000,000 arrays but i'll be damned if i know how to intialise one.
Posted on 2003-04-28 02:30:00 by Crunchi
i can't believe 45 people don't know how to make an array?
Posted on 2003-04-29 01:26:29 by Crunchi
It's an array of three POINT-structures isn't it? They're just like two DWORDS for x and y I think.

Wouldn't this work then:

p1x dd ?
p1y dd ?
p2x dd ?
p2y dd ?
p3x dd ?
p3y dd ?

fill in each points coordinates, and pass the ADDR to p1x to the blit api, did you try it?

or as initialized structs, and pass address to point1

point1 POINT<0,0>
point2 POINT<10,10>
point3 POINT<20,20>
Posted on 2003-04-29 01:48:42 by david
i'll give it a go, thanks!
Posted on 2003-04-29 02:05:23 by Crunchi
a new thing learnt everyday, thanks alot.

i've done too much HLL programming to realise the simple things before me.
Posted on 2003-04-29 02:23:17 by Crunchi
i finally found a neat readable way to do it:

TriPoint POINT {?, ?}, {?, ?}, {?, ?} ; Will hold 3 corners for PlgBlt

they are accessed via:

TriPoint[0].x or y

i hope this saves some noob the time i lost

in PlgBlt...

invoke PlgBlt,... ...,ADDR Tripoint,...
Posted on 2003-05-13 07:15:51 by Crunchi
Or use a struct

tript STRUCT
p1x dword ?
p1y dword ?
p2x dword ?
p2y dword ?
p3x dword ?
p3y dword ?
tript ENDS
Posted on 2003-05-13 07:24:08 by roticv
To make an array of point structures use dup

eg 16 point structures inititialzed with 0

MyArray POINT 16 DUP (0)

When calling move the base into a register and use the following syntax:

mov edi,OFFSET MyArray

mov edx,WhichPoint

Posted on 2003-05-13 07:29:53 by donkey