Recommended Posts

Hello,
I'm making a directx 9 slide show. I'm doing that with CreateOffscreenPlainSurface, D3DXLoadSurfaceFromFile and drawing with StretchRect. Everything is OK, but images bigger than 2400x1600 is not working correctly. What should I do?
bye.

Share this post

Link to post

Share on other sites

Tell us what you mean by is "not working". Does your application crash? If so, what error and where? Does some D3D call fail? Are you using the Debug Runtimes? Do they give any relevant debug output?

Also, what graphics card do you have? If it;s an old-ish card, it's likely that it'll require power-of-two surfaces, so your 2400x1600 surface is being scaled to 4096x2048 (Or 4096x4096 if the card needs square textures). 4k by 2k at 32-bit is 32MB, and if you have a frontbuffer, backbuffer, depth buffer and the source surface, that's 128MB which may exceed your cards VRAM.

Share this post

Link to post

Share on other sites

Tell us what you mean by is "not working". Does your application crash? If so, what error and where? Does some D3D call fail? Are you using the Debug Runtimes? Do they give any relevant debug output?

Also, what graphics card do you have? If it;s an old-ish card, it's likely that it'll require power-of-two surfaces, so your 2400x1600 surface is being scaled to 4096x2048 (Or 4096x4096 if the card needs square textures). 4k by 2k at 32-bit is 32MB, and if you have a frontbuffer, backbuffer, depth buffer and the source surface, that's 128MB which may exceed your cards VRAM.

Two solutions to the problem of hitting the maximum supported texture size would be to downscale/upscale the image or put it together using two or more smaller parts (that do fit).

0

Share this post

Link to post

Share on other sites

No it doesn't crash. Only one part is shown.I'm working this for a school project and I'm new in directx. So I download the DirectX SDK April 2007 and do with DXUT. I have to do also effects like fade-in, fade-out, ... but I don't know how. So I would beg you for help.

0

Share this post

Link to post

Share on other sites

Original post by zokiNo it doesn't crash. Only one part is shown.I'm working this for a school project and I'm new in directx. So I download the DirectX SDK April 2007 and do with DXUT. I have to do also effects like fade-in, fade-out, ... but I don't know how. So I would beg you for help.

What do you mean "part" of it? Which part? Just the top? Bottom? Left? Top left? Are you using the debug runtimes? Anything from them?

0

Share this post

Link to post

Share on other sites

Original post by zokiNo it doesn't crash. Only one part is shown.I'm working this for a school project and I'm new in directx. So I download the DirectX SDK April 2007 and do with DXUT. I have to do also effects like fade-in, fade-out, ... but I don't know how. So I would beg you for help.

What do you mean "part" of it? Which part? Just the top? Bottom? Left? Top left? Are you using the debug runtimes? Anything from them?

Original picture:http://shrani.si/f/5/du/1hmjVYAj/slika4.jpg

Only part of the original:http://shrani.si/f/1q/RB/3sL2iydW/onepart.jpg

I'm running it in debug. Release doesn't look different.

0

Share this post

Link to post

Share on other sites

Have you double checked the parameters you pass to StretchRect? That looks like you're taking an area the size of the window from the source image, and stretching that onto an area the size of the image. I.e. check your source and dest rects are the correct way around.

Also, Do you mean the debug runtimes? Or do you mean a debug build of your app?

0

Share this post

Link to post

Share on other sites

Original post by Evil SteveHave you double checked the parameters you pass to StretchRect? That looks like you're taking an area the size of the window from the source image, and stretching that onto an area the size of the image. I.e. check your source and dest rects are the correct way around.

Also, Do you mean the debug runtimes? Or do you mean a debug build of your app?

Share this post

Link to post

Share on other sites

Can some please tell me if using a surface is the right approach in my project of creating a slideshow. I have to finish that to the end of the month and I'm a little desperate. I don't know what to do. Please help me.