how use PlgBlt() function?

i know the PlgBlt() function is good for draw an image by it's shape.
1
2
3
4
5
6
7
8
9
10
11
12
BOOL PlgBlt(
  HDC         hdcDest,
  const POINT *lpPoint,
  HDC         hdcSrc,
  int         xSrc,
  int         ySrc,
  int         width,
  int         height,
  HBITMAP     hbmMask,
  int         xMask,
  int         yMask
);  


from msdn:
"The PlgBlt function performs a bit-block transfer of the bits of color data from the specified rectangle in the source device context to the specified parallelogram in the destination device context. If the given bitmask handle identifies a valid monochrome bitmap, the function uses this bitmap to mask the bits of color data from the source rectangle."

but my problem is understand the lpPoint parameter:
"A pointer 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."

see these sample:
A |-------------| B

D |------------|C

A - Upper-Left;
B - Upper-Right;
C - Low-Right;
D - Low-Left.

so the points must be:
1
2
3
TexturePoints[0] = Points[0]; //upper-left
    TexturePoints[1] = Points[1]; //upper-right
    TexturePoints [2] = Points[3]; //lower-left  

heres the result:
https://imgur.com/a/mvGh0oL
(ok... the image is from VB6, but the result can be the same.. so i need understand what i'm doing wrong)
the problem seems that the C is badly calculated :(
i'm sorry, but i did these question on some forums, but i can't find my error :(
can anyone explain to me what i'm doing wrong?
Last edited on
Topic archived. No new replies allowed.