FROM : Bus Mini
DATE : Sun Jul 09 18:01:59 2006
On 7/8/06, Chris Hanson <<email_removed>> wrote:
>
>
>
> You'll need to come up with a strategy to avoid blocking the main run
> loop when no image data is available for you to display.
>
> -- Chris
>
>
As your suggestion, I put my code in a thread, then it can work. But another
problem posed.
My thread function like this:
-(void)workThread:(id)param
{
while(1)
{
[self getImage];//this method just modify some pixel in "screenImage",
so I can see the change.
[ImageView setImage:screenImage];
}
}
This function just set the screenImage to ImageView one time, I can not see
the change.
But if I add *[ImageView setImage:otherImage]* before *[ImageView
setImage:screenImage];* then I can see screenImage changed everytimes. So,
I guess, If I just modify some pixel in screenImage, then set it to the
view, ImageView will consider that was the same view, so ImageView do
nothing. But if I set another image to ImageView, the ImageView will konw
that things are changed, it must do something, so it update its
content.AmI right? How can I solve this problem?
Thanks for reading my question.
--
Yours sincerely
Mini Bus.
DATE : Sun Jul 09 18:01:59 2006
On 7/8/06, Chris Hanson <<email_removed>> wrote:
>
>
>
> You'll need to come up with a strategy to avoid blocking the main run
> loop when no image data is available for you to display.
>
> -- Chris
>
>
As your suggestion, I put my code in a thread, then it can work. But another
problem posed.
My thread function like this:
-(void)workThread:(id)param
{
while(1)
{
[self getImage];//this method just modify some pixel in "screenImage",
so I can see the change.
[ImageView setImage:screenImage];
}
}
This function just set the screenImage to ImageView one time, I can not see
the change.
But if I add *[ImageView setImage:otherImage]* before *[ImageView
setImage:screenImage];* then I can see screenImage changed everytimes. So,
I guess, If I just modify some pixel in screenImage, then set it to the
view, ImageView will consider that was the same view, so ImageView do
nothing. But if I set another image to ImageView, the ImageView will konw
that things are changed, it must do something, so it update its
content.AmI right? How can I solve this problem?
Thanks for reading my question.
--
Yours sincerely
Mini Bus.
| Related mails | Author | Date |
|---|---|---|
| Bus Mini | Jul 7, 17:23 | |
| Chris Hanson | Jul 7, 22:38 | |
| Bus Mini | Jul 9, 18:01 | |
| Bus Mini | Jul 9, 18:18 | |
| Uli Kusterer | Jul 11, 00:11 |






Cocoa mail archive

