Results 1 to 8 of 8

Thread: Asphyre and PNG

  1. #1

    Asphyre and PNG

    I'm loading pictures in a quite simple way;

    Code:
    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.
    Making ultimate rpg with thousands of years and every time new random history, people, world....

  2. #2

    Asphyre and PNG

    p.s. The Asphyre I'm using is eXtreme 3.1.0, the program is Delphi 7 personal..!
    Making ultimate rpg with thousands of years and every time new random history, people, world....

  3. #3

    Asphyre and PNG

    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

  4. #4

    Asphyre and PNG

    Quote Originally Posted by Lifepower
    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?
    From brazil (:

    Pascal pownz!

  5. #5

    Asphyre and PNG

    Quote Originally Posted by Lifepower
    Have you tried increasing tolerance value? Or using magenta instead of black?
    Oh, does magenta really work? I gotta try that, thanks.
    Making ultimate rpg with thousands of years and every time new random history, people, world....

  6. #6

    Asphyre and PNG

    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...

  7. #7

    Asphyre and PNG

    (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 ;)
    Making ultimate rpg with thousands of years and every time new random history, people, world....

  8. #8

    Asphyre and PNG

    LoadFromBitmap(sad, true, MaskedColour, tolerance);


    ...so I found it; thanks anyway. The masked colour is the transparent colour.
    Making ultimate rpg with thousands of years and every time new random history, people, world....

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •