Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Adding pixels to TImage Posted by Fylyp on 21 Sept 2006 at 6:16 AM
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
Report
Re: Adding pixels to TImage Posted by Josh Code on 17 Oct 2006 at 5:07 PM
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
:

Report
Re: Adding pixels to TImage Posted by Fylyp on 18 Oct 2006 at 2:40 PM
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
: :
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.