canvas->pixel is slow slow slow...

canvas->pixel is slow slow slow...

Post by JIM » Wed, 25 Aug 1999 04:00:00



 hi...there...

   i want to draw a pic thru pixels...
   and i used to adapting canvas->pixel to have it done dot by dot..
  and it's incredibily slow...

   if there any method like 1. to initial a Graphic base viables first and
then put pixels in,
                                            after all, print the graphic out
via the viables...
                                       2. call DIB to handle ...and how?
                                       3. DirectDraw ...???
   thanx for helping~~~

 
 
 

canvas->pixel is slow slow slow...

Post by Sergei Soroki » Wed, 25 Aug 1999 04:00:00


Hi, JIM!


>    i want to draw a pic thru pixels...
>    and i used to adapting canvas->pixel to have it done dot by dot..
>   and it's incredibily slow...

IMHO, this method (Canvas->Pixels ... = ...) could work more faster if:

1. You set Visible property to false before drawing and then set it back to true
after drawing is finished. For the Canvas 450x550 points it 7-8 times faster.

2. Another possibility is to prepare picture on the other component (which is
invisible at the moment) and then copy it to the first picture.

Of course, some other methods like DirectDraw, I think, might work faster. I
don't know because I've never worked with it. But in the case of DirectDraw you
will not see any forms, buttons and other controls - your have to do it manually
(I hope that I right here).

Sergei.

 
 
 

canvas->pixel is slow slow slow...

Post by Sergei Soroki » Wed, 25 Aug 1999 04:00:00



> 2. Another possibility is to prepare picture on the other component (which is
> invisible at the moment) and then copy it to the first picture.

I foreget to write here what I mean when talking about copying ( hope your already
know about this method but...) :
Image1->Picture->Assign( Image2->Picture);

Regards,
Sergei.

 
 
 

canvas->pixel is slow slow slow...

Post by Michael Warn » Wed, 25 Aug 1999 04:00:00




Quote:>   i want to draw a pic thru pixels...
>   and i used to adapting canvas->pixel to have it done dot by dot..
>  and it's incredibily slow...

The usual technique is to render the picture off-screen using the
Scanline property of a 24-bit pixel format TBitmap, then copy its
Canvas to the on-screen Canvas. Note that the byte order is BGRBGR...

"Hold you in his armchair
 You can feel his disease" - John Lennon

 
 
 

1. TImage->Canvas->Pixels is very slow...

Hi,

I would like to change the RGB value of the pixels of a TCanvas.
Here's my code:

int n = (50 + (50<<8) + (50 <<16));
for (int y = 1; y < 70;y++)
  for (int x = 1;x < 500; x++)
    Image1->Canvas->Pixels[x][y] = Image1->Canvas->Pixels[x][y]-n;

And it's very slow..
Does anyone have another way to do it?

Thanks in advance.

--
Thierry Verrecchia, VP R&D

2. What is the best way to output animations?

3. Illustrator 9 Slow Slow Slow

4. Need jpeg/tiff/gif/.. ==> ascii ==> jpeg/tiff/gif/.. Utility

5. slow, slow, slow

6. Help Wanted

7. JPEG + DELPHI = sloooow, slow slow slow

8. Render Crash

9. Slow Canvas->Draw and Canvas->CopyRect

10. System getting slower and slower

11. Newbie: Gimp runs slow, text looks bad, plot is slow to print

12. Using Canvas->Handle is 1000 times slower

13. Slow reading and writing pixel data in OpenGL