Jump to content

Please help :(


Recommended Posts

I'am creating a game engine (2d for platform games or simple RPG) and i want to obtain a transparent regions on my character and scenery .bmp i found this function GdiTransparentBlt in C:\WINDOWS\system32\gdi32.dll but i dont now how to use it for obtain a transparent bmp im my window. I searched in google but i found that specyfication, but i dont still now how to use it, please give me an example. Really please :)

GdiTransparentBlt

The GdiTransparentBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.

VB4-32,5,6

Private Declare Function GdiTransparentBlt Lib "gdi32.dll" ( _
ByVal hdc As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal nSrcWidth As Long, _
ByVal nSrcHeight As Long, _
ByVal crTransparent As Long _
) As Boolean

Operating Systems Supported
Requires Windows 2000 or later; Win9x/ME: Not supported

Library
gdi32

Parameter Information
· hdcDest

[in] Handle to the destination device context.
· nXOriginDest

[in] Specifies the x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
· nYOriginDest

[in] Specifies the y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
· nWidthDest

[in] Specifies the width, in logical units, of the destination rectangle.
· hHeightDest

[in] Handle to the height, in logical units, of the destination rectangle.
· hdcSrc

[in] Handle to the source device context.
· nXOriginSrc

[in] Specifies the x-coordinate, in logical units, of the source rectangle.
· nYOriginSrc

[in] Specifies the y-coordinate, in logical units, of the source rectangle.
· nWidthSrc

[in] Specifies the width, in logical units, of the source rectangle.
· nHeightSrc

[in] Specifies the height, in logical units, of the source rectangle.
· crTransparent

[in] The RGB color in the source bitmap to treat as transparent.

Return Values
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE.
Windows NT/ 2000: To get extended error information, call GetLastError

http://msdn2.microsoft.com/en-us/library/ms797469.aspx here i found another this type of documentation, im to nooby ;) please show me only a little example of the dllCall or simple example script with transparency. Thank You very much.

Edited by Uriziel01
Link to comment
Share on other sites

WooooooooooooooooooooooooooooooooooooW! Thank ! I think i must read more threads on this board ! THANK YOU ZEDNA !!!! I Love it !

You just must use clever searching  ;)

I knew about these topics but didn't know exact address so I searched keyword "sprite" :)

Have fun with it and don't forget to post some of yours AutoIt games here ;)

Link to comment
Share on other sites

Thats looks liek a pretty cool game, especially from being written in autoit. Cant wait to play.

No probelm, this is a pre pre pre ALFA version of the game ;) The package includes a all needed files, font(you must copy if to C:/Windows/Fonts/), the compiled script and the source code. :) Sory for the lang of game (PL) but i'am doing it for my friend and it must be in these leanguage. Please reply how do you like it ;)

EDIT:

I searched threads gived my by ZEDNA but i still didnt find any function for making this blue box transparent (i dont want to build all engine from 0, i only want transprent frame on car) :( Help :(

http://www.speedyshare.com/118987856.html

EDIT:

Och! BTW use SPACE to shot and ENTER to reload (the lv is up by 1, and the speed of enemy is increasing when reloading), but only when you ouy of ammo ;) You like it ? But Remember ! THIS IS ONLY AN ALFA !

Edited by Uriziel01
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...