CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    1,355

    how use PlgBlt() API function?

    ok.. the PlgBlt () API functions is for draw an image and it can be rotated too:
    Code:
    Private Declare Function PlgBlt Lib "gdi32" Alias "PlgBlt" (
    ByVal hdcDest As Long, 
    lpPoint As POINTAPI, 
    ByVal hdcSrc As Long, 
    ByVal nXSrc As Long, 
    ByVal nYSrc As Long, 
    ByVal nWidth As Long, 
    ByVal nHeight As Long, 
    ByVal hbmMask As Long, 
    ByVal xMask As Long, 
    ByVal yMask As Long) As Long
    i need understand somethings about these function:
    what is the lpPoint(POINT structure\type)? what is for? how can i use it?
    the hbmMask is the image for transparency?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: how use PlgBlt() API function?

    Search bing or google for "Plgblt win32".

  3. #3
    Join Date
    Apr 2009
    Posts
    1,355

    Re: how use PlgBlt() API function?

    "lpPointA 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."
    from: https://docs.microsoft.com/en-us/win...-wingdi-plgblt
    and seems that i only need 3 points instead 4 points... was here that i was confused...

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: how use PlgBlt() API function?

    The fourth point coordinates are easily calculated from the other three points:
    https://www.google.com/search?newwin...sclient=psy-ab
    Last edited by VictorN; September 21st, 2020 at 01:30 PM. Reason: spell check
    Victor Nijegorodov

  5. #5
    Join Date
    Apr 2009
    Posts
    1,355

    Re: how use PlgBlt() API function?

    please i need understand more 1 thing: imagine that i have 1 plane.
    we have the vector's A, B, C and D(the plane have 4 vectors)... every vector have their own X,Y and Z(thing that i know them, so we can use VA, VB, VC and VD to identify the plane vectors....
    now how can i add the vectors on point's array?

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: how use PlgBlt() API function?

    Quote Originally Posted by Cambalinho View Post
    please i need understand more 1 thing: imagine that i have 1 plane.
    we have the vector's A, B, C and D(the plane have 4 vectors)... every vector have their own X,Y and Z(thing that i know them, so we can use VA, VB, VC and VD to identify the plane vectors....
    now how can i add the vectors on point's array?
    It's up to you to convert your vector's values to XY coordinates to pass to the calculation formulas (if you still need it!) and then to the PlgBlt() API function.
    Victor Nijegorodov

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: how use PlgBlt() API function?

    Have a look at https://patch.com/new-jersey/wyckoff...her-3-geometry
    Here you will find how to calculate thecoordinates of the fourth point.
    If it would be not enough - use Google
    Victor Nijegorodov

  8. #8
    Join Date
    Apr 2009
    Posts
    1,355

    Re: how use PlgBlt() API function?

    but the PlgBltpoint(4), is:
    Code:
    dim VA as POINTAPI
    dim VB as POINTAPI
    dim VC as POINTAPI
    dim VD as POINTAPI
    dim PlgBltpoint(4) as POINTAPI
    
    'here i know their X and Y values(i know convert 3D to 2D)
    'then i can add the points:
    PlgBltpoint(0)=VA
    PlgBltpoint(1)=VB
    PlgBltpoint(2)=VC
    PlgBltpoint(3)=VD
    
    'add it to the function:
    PlgBlt PlgBltpoint.....
    so is these assignment correct?
    so it's the same if i have more than 4 vectors?
    Last edited by Cambalinho; September 21st, 2020 at 04:46 PM.

  9. #9
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: how use PlgBlt() API function?

    Quote Originally Posted by Cambalinho View Post
    but the PlgBltpoint(4), is:
    Code:
    dim VA as POINTAPI
    dim VB as POINTAPI
    dim VC as POINTAPI
    dim PlgBltpoint(4) as POINTAPI
    ...
    'then i can add the points:
    PlgBltpoint(0)=VA
    ...
    PlgBltpoint(3)=VD
    
    'add it to the function:
    PlgBlt PlgBltpoint.....
    so is these assignment correct?
    Well, as long as VA is the upper-left corner of the parallelogram, VB is the upper-right corner, and VC and the lower-left corner then it looks promising.
    Victor Nijegorodov

  10. #10
    Join Date
    Apr 2009
    Posts
    1,355

    Re: how use PlgBlt() API function?

    is like:
    (upper-left)VA - VB(upper-right)
    (low-right)VC - VD(low-left)

  11. #11
    Join Date
    Apr 2009
    Posts
    1,355

    Re: how use PlgBlt() API function?

    i'm sorry, but you miss some words?
    "... VB is the upper-right corner, and VC and the lower-left corner then it looks..."

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: how use PlgBlt() API function?

    Quote Originally Posted by Cambalinho View Post
    i'm sorry, but you miss some words?
    "... VB is the upper-right corner, and VC and the lower-left corner then it looks..."
    What did I miss?
    Victor Nijegorodov

  13. #13
    Join Date
    Apr 2009
    Posts
    1,355

    Re: how use PlgBlt() API function?

    maybe i was confused.. nothing more.. sorry

  14. #14
    Join Date
    Apr 2009
    Posts
    1,355

    Re: how use PlgBlt() API function?

    thank you so much for all... thank you

  15. #15
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: how use PlgBlt() API function?

    You are welcome!
    Victor Nijegorodov

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured