BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange load in TImage while mouse moves

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Benny Dein
Guest





PostPosted: Wed Oct 29, 2003 9:51 pm    Post subject: Strange load in TImage while mouse moves Reply with quote



Hi

I have 55 TImage components on a single form.

I takes some time to load them all, because the images should be converted
and manipulated first. Therefore i've made a thread that creates an
objectlist with TBitmaps with the images and when the thread terminates I
load the TImages on my form from the objectlist, by assigning the bitmaps to
them.

How can it be, that if I move the mouse while the TImages being loaded, some
of them are only partially drawn. If I don't touch the mouse ,all are shown
correctly.

A TImage.Repaint dosn't help.

Anyone knows how to solve this?

I'm using D5, Enterprise

Thank in advance, Benny


Back to top
Finn Tolderlund
Guest





PostPosted: Wed Oct 29, 2003 10:15 pm    Post subject: Re: Strange load in TImage while mouse moves Reply with quote



Buggy mouse driver or display driver?
--
Finn Tolderlund


"Benny Dein" <benremnyove (AT) thdeinis (DOT) dk> skrev i en meddelelse
news:3fa035b2$1 (AT) newsgroups (DOT) borland.com...
Quote:
How can it be, that if I move the mouse while the TImages being loaded,
some
of them are only partially drawn. If I don't touch the mouse ,all are
shown
correctly.



Back to top
Benny Dein
Guest





PostPosted: Thu Oct 30, 2003 7:36 am    Post subject: Re: Strange load in TImage while mouse moves Reply with quote



I have now tried my program on another pc with same results. It seems not to
be problems with driver...

Quote:
Buggy mouse driver or display driver?
--
Finn Tolderlund



Back to top
Robert Cerny
Guest





PostPosted: Thu Oct 30, 2003 11:54 am    Post subject: Re: Strange load in TImage while mouse moves Reply with quote

Does your thread post a message to form when it finishes?
Does then this message handler load the images?
If not, it should be this way. The thread needs not post the message at the
end, but can do it after each image (posting the image index too), if you
prefer so.

Lots of strange things can happen, if you assign images from the thread.
--
Robert Cerny
DelphiShaman
"Benny Dein" <benremnyove (AT) thdeinis (DOT) dk> wrote

Quote:
Hi

I have 55 TImage components on a single form.

I takes some time to load them all, because the images should be converted
and manipulated first. Therefore i've made a thread that creates an
objectlist with TBitmaps with the images and when the thread terminates I
load the TImages on my form from the objectlist, by assigning the bitmaps
to
them.

How can it be, that if I move the mouse while the TImages being loaded,
some
of them are only partially drawn. If I don't touch the mouse ,all are
shown
correctly.

A TImage.Repaint dosn't help.

Anyone knows how to solve this?

I'm using D5, Enterprise

Thank in advance, Benny





Back to top
Finn Tolderlund
Guest





PostPosted: Thu Oct 30, 2003 4:13 pm    Post subject: Re: Strange load in TImage while mouse moves Reply with quote

Then you will have to provide more info in order for us to be able to help
you.
--
Finn Tolderlund


"Benny Dein" <rembdeove (AT) edbthisgruppen (DOT) dk> skrev i en meddelelse
news:3fa0bf70$1 (AT) newsgroups (DOT) borland.com...
Quote:
I have now tried my program on another pc with same results. It seems not
to
be problems with driver...

Buggy mouse driver or display driver?



Back to top
Benny Dein
Guest





PostPosted: Thu Oct 30, 2003 9:09 pm    Post subject: Re: Strange load in TImage while mouse moves Reply with quote

Lets say I have a form with 20 TImage on it, that are loaded with some
jpegs.

The TImage dosn't do a resample when loading, so the images are not 'smooth'
and nice.

I have found an algoritme for resampling them which takes about 0.5 seconds
for each. I don't want the user to wait for this, so I do a resample of each
image in background, in a thread. When the thread terminates it places
resampled bitmaps in an objectlist (property on my form) on the form and
asks the form to reload the images from this objectlist.

Now the main form assign the bitmaps into the images on the form.

If I don't move the mouse under this last proces all works fine. If I move
the mouse, some of the images turn all white, some are ok and some are
partially white and partially ok.

Blev du klogere af det?

"Finn Tolderlund" <no (AT) spam (DOT) dk> skrev i en meddelelse
news:3fa138b5 (AT) newsgroups (DOT) borland.com...
Quote:
Then you will have to provide more info in order for us to be able to help
you.
--
Finn Tolderlund


"Benny Dein" <rembdeove (AT) edbthisgruppen (DOT) dk> skrev i en meddelelse
news:3fa0bf70$1 (AT) newsgroups (DOT) borland.com...
I have now tried my program on another pc with same results. It seems
not
to
be problems with driver...

Buggy mouse driver or display driver?





Back to top
Finn Tolderlund
Guest





PostPosted: Fri Oct 31, 2003 6:54 am    Post subject: Re: Strange load in TImage while mouse moves Reply with quote

"Benny Dein" <benremnyove (AT) thdeinis (DOT) dk> skrev i en meddelelse
news:3fa17d4d$1 (AT) newsgroups (DOT) borland.com...
Quote:
Lets say I have a form with 20 TImage on it, that are loaded with some
jpegs.

The TImage dosn't do a resample when loading, so the images are not
'smooth'
and nice.

I have found an algoritme for resampling them which takes about 0.5
seconds
for each. I don't want the user to wait for this, so I do a resample of
each
image in background, in a thread. When the thread terminates it places
resampled bitmaps in an objectlist (property on my form) on the form and
asks the form to reload the images from this objectlist.

Now the main form assign the bitmaps into the images on the form.

If I don't move the mouse under this last proces all works fine. If I move
the mouse, some of the images turn all white, some are ok and some are
partially white and partially ok.

Blev du klogere af det?

Ja måske.
The first thing that comes to mind is that your thread code is faulty.
What have you done to debug this?
Have you tried to remove the thread thing and just load the images without
resampling, how does it work then?
Can you make a small app that shows the problem and post it in
b.p.attachments?
--
Finn Tolderlund



Back to top
Benny Dein
Guest





PostPosted: Mon Nov 03, 2003 7:57 pm    Post subject: Re: Strange load in TImage while mouse moves Reply with quote

Thanks for helping!

I have now tried replacing the resamling code by a simple reload in same
quality as original. It seems as the failure is in the resample algorithme,
because avoiding this code gives me ok images.

Benny

Quote:
The first thing that comes to mind is that your thread code is faulty.
What have you done to debug this?
Have you tried to remove the thread thing and just load the images without
resampling, how does it work then?
Can you make a small app that shows the problem and post it in
b.p.attachments?
--
Finn Tolderlund





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.