PNG image from resource…

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #34336
    durumdara
    Participant

    Hi!

    I want to create a Alpha Bitbtn that have N kind, and all Kind have a predefined hungarian caption, glyph, and modalresult.

    Everything is ok with it, only one thing I don't know – this is PNG image list that came from resource.

    I saw here, how to load PNG Image from resource, and how to store them before.

    http://www.ciuly.com/delphi/multimedia/loading-a-png-image-from-a-resource/

    But this is an unknown area for me. As I see the sAlphaImageList supports “Add” methods, but they are need Bitmaps.

    I don't know, how to load PNG image from resource, and how to pass to Add method.

    Can you help me in this?

    Thanks:

    dd

    Ps:

    And is it bug?

    else begin

    Png := TPNGGraphic.Create;

    rs := TResourceStream.Create(hInstance, ResName, RT_RCDATA); // aInstance needed, or not?

    #44779
    durumdara
    Participant

    Hi!

    I've created a test application.

    When I try to set imageindex on buttons, I got error:

    sGraphUtils:


    Debugger Exception Notification


    Project Project1.exe raised exception class EIntOverflow with message 'Integer overflow'. Process stopped. Use Step or Run to continue.


    OK Help


    Delphi 6 Prof, Win7:

    if B < 0 then Dest.rgbtBlue := 0 else if B > $FF0000 then

    Dest.rgbtBlue := $FF

    else

    Dest.rgbtBlue := B shr 16;

    if DWORD(Dest) + DWORD(dstDelta) < MAXDWORD then DWORD(Dest) := DWORD(Dest) + dstDelta // HERE? end; Thanks: dd [attachment=4575:PNGImageList.zip]

    #44814
    Support
    Keymaster

    Hello and thank you for the example.

    This error will be fixed in the nearest release, I think. Please wait few days.

    #44817
    durumdara
    Participant
    'Support' wrote:

    Hello and thank you for the example.

    This error will be fixed in the nearest release, I think. Please wait few days.

    Hi!

    Thank you!

    Please write here some example: what will working in the next release.

    Thanks:

    dd

    #44819
    Support
    Keymaster

    Your code must be working there 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.