Yes, this save a PNG without transparency,
the question is that I want a PNG with transparency, but I cant.
I try to create two function.
One that read a waypoints from a file and draw its in a brush.
Second that save brush in all image format.
Code: Select all
Function DrawAIW(wX, hY)
...
CreateBrush(1, wX, hY)
...
EndFunction
Function Save_Brush()
fname$ = UnleftStr(FilePart(file$), 3).."png"
pname$ = PathPart(file$)
image$ = FileRequest("Save Image", "png|jpg|gif|bmp", #REQ_SAVEMODE, pname$, fname$)
var$ = RightStr(image$, 3)
If image$<>""
Switch var$
Case "png":
fmt = #IMGFMT_PNG
Case "jpg":
fmt = #IMGFMT_JPEG
Case "bmp":
fmt = #IMGFMT_BMP
Case "gif":
fmt = #IMGFMT_GIF
EndSwitch
SaveBrush(brush, image$, #BLACK, fmt, {dither=True})
EndIf
EndFunction
With this code, when I select to save brush as PNG, the image file
not have transparency.
But if I select to save in GIF format, image file have transparency (this is ok and what I want)