Notifications
Clear all
[Closed] bitmap… support png with alpha?
Apr 06, 2011 4:42 pm
i am trying to put a png with alpha, but the alpha don’t work.
bmp1.filename = “c:\ est.png”
i am doing something wrong or is any special save setting for the png file?
any alternative?
thanks
1 Reply
Apr 06, 2011 4:42 pm
no special save setting that I know of.
i’d start by checking to make sure that bmp1 contains alpha data.
what do you get back from a print of the bitmap array?
here’s a snippet showing how to check for an alpha value in an arbitrary bitmap:
for g = 0 to myBitmap.height by 1 do --for the height of the bitmap
(
local myPixelRow = getPixels myBitmap [0,g] myBitmap.width --get a row of pixels
for j = 1 to myPixelRow.count do --for every pixel in the row
(
if myPixelRow[j] != (color 0 0 0 0) then --if the pixel isn't completely transparent
(
myCoordinates = point2 (j-1) g
print myCoordinates --print the pixel coordinate
)
)
)