Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Adding pixels to TImage

Hi,

I've got a 2-dimentional array with pixels' luminance in it.
I want to add them as an image to the TImage component.
Is there any simpler (and quicker) method than adding
pixels to TImage Canvas?
Any help will be appreciated.

Best wishes
Philip

Comments

  • Josh CodeJosh Code Posts: 675Member
    The most efficient way is not the simplest way.

    The most efficient way involves accessing the image's pixel data directly.

    Take a look at the example here:
    http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=816&lngWId=7

    The clearest way of copying pixels from an array to the image is probably by using the canvas.pixels property. This is, however, I think 100's of times slower in execution because of what happens without you seeing. It involves separate method calls and interupts with every pixel accessed.

    : Hi,
    :
    : I've got a 2-dimentional array with pixels' luminance in it.
    : I want to add them as an image to the TImage component.
    : Is there any simpler (and quicker) method than adding
    : pixels to TImage Canvas?
    : Any help will be appreciated.
    :
    : Best wishes
    : Philip
    :

  • FylypFylyp Posts: 13Member
    Thanks,

    i've used the idea from that example and it really
    works much faster.

    Best wishes,
    Philip

    : The most efficient way is not the simplest way.
    :
    : The most efficient way involves accessing the image's pixel data directly.
    :
    : Take a look at the example here:
    : http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=816&lngWId=7
    :
    : The clearest way of copying pixels from an array to the image is probably by using the canvas.pixels property. This is, however, I think 100's of times slower in execution because of what happens without you seeing. It involves separate method calls and interupts with every pixel accessed.
    :
    : : Hi,
    : :
    : : I've got a 2-dimentional array with pixels' luminance in it.
    : : I want to add them as an image to the TImage component.
    : : Is there any simpler (and quicker) method than adding
    : : pixels to TImage Canvas?
    : : Any help will be appreciated.
    : :
    : : Best wishes
    : : Philip
    : :
    :
    :

Sign In or Register to comment.