Adding pixels to TImage - Programmers Heaven

Howdy, Stranger!

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

Categories

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.