How to make the background transparent?
Little_man
Code: Select all
UsePNGImageDecoder()
UsePNGImageEncoder()
Global Dim File$(0), FileCount
Global.i Width = 370
Global.i Height = 376
Global.i Seoerator = 20
ExamineDirectory(0, "C:\Dump", "*.png")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) & #PB_DirectoryEntry_File
File$(FileCount) = DirectoryEntryName(0)
FileCount + 1
ReDim File$(FileCount)
EndIf
Wend
Debug FileCount
For X = 0 To FileCount - 1 Step 4
CreateImage(10, 1580, 410)
LoadImage(0, "C:\Dump\" + File$(X)) ;Transparent.
LoadImage(1, "C:\Dump\" + File$(X + 1)) ;Transparent.
LoadImage(2, "C:\Dump\" + File$(X + 2)) ;Transparent.
LoadImage(3, "C:\Dump\" + File$(X + 3)) ;Transparent.
StartDrawing(ImageOutput(10))
;DrawingMode(#PB_2DDrawing_Transparent)
FrontColor($FFFFFF)
DrawImage(ImageID(0), 20, 20)
DrawImage(ImageID(1), 410, 20)
DrawImage(ImageID(2), 800, 20)
DrawImage(ImageID(3), 1190, 20)
StopDrawing()
SaveImage(10, "c:\Dump\1\" + Str(X) + ".png",#PB_ImagePlugin_PNG) ;Background "Black"
FreeImage(10)
Next