PDA

View Full Version : Asphyre and PNG



Rojekti
10-10-2007, 06:56 PM
I'm loading pictures in a quite simple way;




procedure AddImage(im:string; where:TAsphyreImages; tolerance:integer);
var
sad:TBitmap;
begin
sad := TBitmap.Create;
sad.LoadFromFile(im);
with where.Add do
begin
Quality := aqHigh;
AlphaLevel := alFull;
PatternSize:= Point(sad.Width, sad.Height);
Size := Point(sad.Width, sad.Height);
VisibleSize:= Point(sad.Width, sad.Height);
LoadFromBitmap(sad, true, 0, tolerance);
Name := (extractfilename(kuva));
end;
sad.Free;
end;



..and I now got mad because this system really doesn't support the black colour: the tolerance defines how black areas are transparent, and this means that there is no black colour. It causes me few problems.


So I'm asking: since I want to retain this my current imageloading system (no TASDB), how I can load PNG- images to Asphyre? Should I just get somewhere a PNG- unit and then change BMP-files into PNG and load them just like before?

This really would make it.

Rojekti
10-10-2007, 06:59 PM
p.s. The Asphyre I'm using is eXtreme 3.1.0, the program is Delphi 7 personal..!

LP
10-10-2007, 08:56 PM
Have you tried increasing tolerance value? Or using magenta instead of black?

Btw, soon Asphyre Compact Framework (for 2D) is to be released, supporting DX7 as minimal requirement ;)

arthurprs
10-10-2007, 09:14 PM
Have you tried increasing tolerance value? Or using magenta instead of black?

Btw, soon Asphyre Compact Framework (for 2D) is to be released, supporting DX7 as minimal requirement ;)
Asphyre Compact Framework

I use Asphyre3 and looks perfect to me, you can give us more info about the outcoming compact framework?

Rojekti
11-10-2007, 05:10 PM
Have you tried increasing tolerance value? Or using magenta instead of black?

Oh, does magenta really work? I gotta try that, thanks.

User137
11-10-2007, 08:06 PM
I've usually solved black transparency with something very close to black, like RGB(10,10,10). Even msPaint can fill with that and save to PNG, though that makes image lose alpha channel...

Rojekti
12-10-2007, 11:04 AM
(Hoh, sin?§kin t?§?§ll?§.)


Hmm, how does Asphyre's alpha channel actually work? In DelphiX it chose the transparent colour automatically (if not manually chosen) from the pixel (0,0), and only colours with exactly the same colour, were transparent.. but how about Asphyre? Does it choose the transparent colour, or is it static (black [/ magenta?]) ?

I can test that magenta today in the evening, it shall be seen then.. but it would be better to understand the system ;)

Rojekti
13-10-2007, 07:18 PM
LoadFromBitmap(sad, true, MaskedColour, tolerance);


...so I found it; thanks anyway. The masked colour is the transparent colour.