List
Add
Info
Contact
Stats
To edit this entry i need username and password!
Fields marked * are required!
* Username:
* Password:
Type:
Sourcecode (WITHOUT BBCode support)
Name:
Font Blit mit Alpha
* Data:
(max. 1 MB)
Available TAG's (new window)
'############################################################################################################################################ Function ELISC_GFX_BMPLoad(V_FilePathName as String) as FB.Image Ptr If Dir(V_FilePathName, -1) = "" Then Return 0 Dim XFN as Integer = FreeFile() If Open(V_FilePathName For Binary Access Read As #XFN) <> 0 Then Return 0 Dim TW as Integer Dim TH as Integer Get #XFN, 19, TW Get #XFN, 23, TH Close #XFN Dim TImg as FB.Image Ptr = ImageCreate(TW, Abs(TH), 32) If TImg = 0 Then Return 0 BLoad V_FilePathName, TImg Return TImg End Function '############################################################################################################################################ Function ELISC_GFX_DrawTextBlitter(V_SourcePix as UInteger, V_DestPix as UInteger, V_Param as UInteger Ptr) as UInteger If (V_SourcePix and &HFFFFFF) = &HFF00FF Then Return V_DestPix If (V_SourcePix and &HFFFFFF) = &H000000 Then Return V_DestPix Dim TA as UInteger = V_SourcePix and &H0000FF Dim TDR as UInteger = (V_DestPix and &HFF0000) shr 16 Dim TDG as UInteger = (V_DestPix and &H00FF00) shr 8 Dim TDB as UInteger = (V_DestPix and &H0000FF) Dim TPR as UInteger = (*V_Param and &HFF0000) shr 16 Dim TPG as UInteger = (*V_Param and &H00FF00) shr 8 Dim TPB as UInteger = (*V_Param and &H0000FF) Dim TOut as UInteger If TDR > TPR Then TOut = TPR + (TDR - TPR) / 255 * (255 - TA) Else: TOut = TDR + (TPR - TDR) / 255 * TA End If TOut shl= 8 If TDG > TPG Then TOut or= TPG + (TDG - TPG) / 255 * (255 - TA) Else: TOut or= TDG + (TPG - TDG) / 255 * TA End If TOut shl= 8 If TDB > TPB Then TOut or= TPB + (TDB - TPB) / 255 * (255 - TA) Else: TOut or= TDB + (TPB - TDB) / 255 * TA End If Return TOut End Function '############################################################################################################################################ Sub ELISC_GFX_DrawText(V_Img as Any Ptr, V_Font as FB.Image Ptr, V_PosX as UInteger, V_PosY as UInteger, V_Width as UInteger, V_Text as String, V_ColText as UInteger) 'MutexLock(ELISC_Mutex) Dim TW as UInteger = V_Font->width / 255 Dim TPos as UInteger = V_PosX + V_Width - 6 - (Len(V_Text) + 1) * TW For X as UInteger = 1 to Len(V_Text) Put Cast(Any Ptr, V_Img), (TPos + (X * TW), V_PosY), Cast(Any Ptr, V_Font), (V_Text[X - 1] * TW, 0)-((V_Text[X - 1] + 1) * TW , V_Font->height), CUSTOM, @ELISC_GFX_DrawTextBlitter, @V_ColText Next 'MutexUnLock(ELISC_Mutex) End Sub
Filetype / Highlight:
freeBASIC
Action: