Hi,

As the title indicated, does anyone has any easy solution?

I found the I have trouble attaching images to the PictureBox in a separate
thread. Basically it just hang there and not even catch it. I am really
stuck at there. On the other hand, direct calling the function without
thread is fine.

Hope someone can give some guide line to this beginner.

Thanks for reading.

Re: How to display Image without using PictureBox? by ctacke/>

ctacke/>
Sat Jun 11 11:54:34 CDT 2005

You cannot affect UI elements from a worker thread. Use Control.Invoke to
marshal calls back to the UI thread and affect the UI from there.

And for the archive, if you want to not use the PictureBox, use another
control like a Panel, override its OnPaint and manually paint the picture
there.

-Chris


"Gravity" <gravity@nospam.org> wrote in message
news:eyJt1VqbFHA.4040@TK2MSFTNGP14.phx.gbl...
> Hi,
>
> As the title indicated, does anyone has any easy solution?
>
> I found the I have trouble attaching images to the PictureBox in a
> separate
> thread. Basically it just hang there and not even catch it. I am really
> stuck at there. On the other hand, direct calling the function without
> thread is fine.
>
> Hope someone can give some guide line to this beginner.
>
> Thanks for reading.
>



RE: How to display Image without using PictureBox? by LionelReyero

LionelReyero
Sun Jun 12 06:18:03 CDT 2005

Hi,

You can also consider P/Invoking the Game API, especially if you are
interested in high performance. This API is low level, it enables your
application to write bitmap directly into the display memory. It will work to
display image from the worker thread with that. As it is more complicated
than the PictureBox, I suggest you should only take a look at it if you are
interested in high performance display.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/APISP/html/sp_gx_bvrh.asp

Lionel

"Gravity" wrote:

> Hi,
>
> As the title indicated, does anyone has any easy solution?
>
> I found the I have trouble attaching images to the PictureBox in a separate
> thread. Basically it just hang there and not even catch it. I am really
> stuck at there. On the other hand, direct calling the function without
> thread is fine.
>
> Hope someone can give some guide line to this beginner.
>
> Thanks for reading.
>
>
>

Re: How to display Image without using PictureBox? by Gravity

Gravity
Sun Jun 12 10:06:58 CDT 2005

Thanks for the link. It do help. : )

"Lionel Reyero" <LionelReyero@discussions.microsoft.com> wrote in message
news:D5672E09-DA7A-4856-851C-1025926D77F7@microsoft.com...
> Hi,
>
> You can also consider P/Invoking the Game API, especially if you are
> interested in high performance. This API is low level, it enables your
> application to write bitmap directly into the display memory. It will work
> to
> display image from the worker thread with that. As it is more complicated
> than the PictureBox, I suggest you should only take a look at it if you
> are
> interested in high performance display.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/APISP/html/sp_gx_bvrh.asp
>
> Lionel
>
> "Gravity" wrote:
>
>> Hi,
>>
>> As the title indicated, does anyone has any easy solution?
>>
>> I found the I have trouble attaching images to the PictureBox in a
>> separate
>> thread. Basically it just hang there and not even catch it. I am really
>> stuck at there. On the other hand, direct calling the function without
>> thread is fine.
>>
>> Hope someone can give some guide line to this beginner.
>>
>> Thanks for reading.
>>
>>
>>