Uriziel01 Posted August 21, 2007 Posted August 21, 2007 (edited) 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 expandcollapse popupGdiTransparentBlt 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 GetLastErrorhttp://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 August 21, 2007 by Uriziel01
Zedna Posted August 21, 2007 Posted August 21, 2007 (edited) This function is not standard API it's for drivers. About transaparency in Autoit search forum, keywords: $GUI_BKCOLOR_TRANSPARENT CreateRectRgn CombineRgn SetWindowRgn PathToRegion Also search for BMP2RGN.dll from Larry Edited August 21, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Uriziel01 Posted August 21, 2007 Author Posted August 21, 2007 (edited) ok, i understand, i must create this in eclypse to be transparent (i mean the blue around the car)may i ask for some example please. thank you for reply at all Edited August 21, 2007 by Uriziel01
Zedna Posted August 21, 2007 Posted August 21, 2007 (edited) For this is better to use sprites.Look at:prospeed A2DDirect3DOpenGl plugin Edited August 21, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Uriziel01 Posted August 21, 2007 Author Posted August 21, 2007 WooooooooooooooooooooooooooooooooooooW! Thank ! I think i must read more threads on this board ! THANK YOU ZEDNA !!!! I Love it !
Uriziel01 Posted August 21, 2007 Author Posted August 21, 2007 WooooooooooooooooooooooooooooooooooooW! Thank ! I think i must read more threads on this board ! THANK YOU ZEDNA !!!! I Love it !
Zedna Posted August 21, 2007 Posted August 21, 2007 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 Resources UDF ResourcesEx UDF AutoIt Forum Search
Mast3rpyr0 Posted August 21, 2007 Posted August 21, 2007 Thats looks liek a pretty cool game, especially from being written in autoit. Cant wait to play. My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here!
Uriziel01 Posted August 22, 2007 Author Posted August 22, 2007 (edited) 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.htmlEDIT: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 August 22, 2007 by Uriziel01
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now