Remi Thomas

Hi,

GDI+ to display large image with zoom and scrollbars works great but is slow.

Do you think XNA (and DirectX) can be use to achieve this faster

Is see some difficult points (I discover XNA)

- Add scroolbars to a window

- Have two or more window

- Convert my own in memory image format to XNA image format

What do you think

Sincerely,

Remi



Re: XNA Framework Using XNA for fast bitmap display

Jim Perry

The XNA Framework/GSE is not meant for image processing applications, it's meant for game development.




Re: XNA Framework Using XNA for fast bitmap display

Kyle_W

True, but I think it could be made to work for Remi's application, and I think it would in fact update more smoothly than GDI+. There is a post on the following blog about hosting an XNA game window inside of a Windows Forms PictureBox control, which would give you the ability to put Windows Forms scroll bars on the side of the PictureBox for manipulation:

http://tonigreco.spaces.live.com/





Re: XNA Framework Using XNA for fast bitmap display

Jim Perry

True, it would probably work better than GDI+. There might be a problem with the "two windows" thing though.




Re: XNA Framework Using XNA for fast bitmap display

Remi Thomas

I was talking with a game developer and he thinks it's easier to do it in C++ with DirectX SDK. So do I.

I think I'll do a DirectX C++/CLI wrapper for .NET specialized for fast bitmap display.

I'll publish this work in codeplex I think for two reasons:

- I'm not a DirectX expert and community experience could help me a lot on this

- We miss having a fast image display in .NET

When I begin this project I'll come here to ask the community point of view and help.

Thanks,

Remi





Re: XNA Framework Using XNA for fast bitmap display

Kyle_W

Well if you are more comfortable doing it in C++ you can certainly do that, but I'm still confident that you could do everything you want with the XNA API, and the XNA API is much easier to use in my opinion. With regard to having two or more windows, if you use the PictureBox method I mentioned earlier, you could have two or more PictureBox controls on a Windows Form, each rendering a separate XNA device view. One thing I will mention about the PictureBox method, which you will see if you look at the sample, is that you have to create your XNA device manually and handle its events, which means you lose the automatic device management benefits of the XNA Game class, but it's not all that bad. Also, if you elected for a solution which uses the XNA Game class, you could achieve two windows by using viewports as described here:

http://msdn2.microsoft.com/en-us/library/bb313965.aspx