DIB to DX8 Display

DIB to DX8 Display

Post by Joe » Mon, 30 Jun 2003 01:43:43



I need to take a DIB created from a JPEG decode (using IJL lib) and
display it using DX8 (or 7 or 9)

In Win API BITBLT, speed is OK. STRETCHBLT for larger display
requestes(Blow up to fullscreen,etc) it is horrendously slow

DX8 funcion that loads a JPEG from file is pitifully slow under DX8,
and the JPEG source is from the wire, never on a disk file

VB6 code snippet that works ( and is faster than BIT/BLT And
StretchBLT) will be rewarded. Looking for speed similar to Media
player full screen speeds.

URGENT (06-28-03 Post)
Joe

 
 
 

DIB to DX8 Display

Post by Mike D Sutto » Mon, 30 Jun 2003 08:45:12


Quote:> I need to take a DIB created from a JPEG decode (using IJL lib) and
> display it using DX8 (or 7 or 9)

> In Win API BITBLT, speed is OK. STRETCHBLT for larger display
> requestes(Blow up to fullscreen,etc) it is horrendously slow

> DX8 funcion that loads a JPEG from file is pitifully slow under DX8,
> and the JPEG source is from the wire, never on a disk file

> VB6 code snippet that works ( and is faster than BIT/BLT And
> StretchBLT) will be rewarded. Looking for speed similar to Media
> player full screen speeds.

You'd probably be better off posting this to a DirectX group, this groups
tends to deal more with VB and GDI problems, with that in mind here's a few
things that you could try (I've only done a little DX development in the
past though, and never dealt with this directly before so exactly how
helpful this will be, I don't know..)
Create your texture using CreateTexture(), and make sure you specify only 1
level so it doesn't spend unnecessary time creating all the mip-maps for
you.  You may not be able to create this texture at the same size as your
original image though due to the limitations of the hardware (Many require
sizes in powers of two and/or square textures) so you'll have to check the
TextureCaps of the device to see what you can get away with there.  Once
you're created it you can use GetSurfaceLevel() to get a pointer to the
surface data then LockRect() to get access to the memory block that
comprises the texture data.  Write your image scanline into this one by one
(If you use the IJG library then you can probably get it decompress it's
data directly to this area for extra speed) taking care to get your scans
lines up and at the same depth (And channel order!) as the surface
requires - Be aware that the scans are most likely not going to be stored
contiguously because the Pitch of the texture is likely not the same as the
width.  when you're done, UnlockRect() to set the data and you've got a
texture to draw with.  Now all you need to do is SetTexture() this and draw
your mesh data (Make sure you've got texture coordinates and ambient
lighting in your vertex definitions though.)
Hope this helps,

    Mike

 - Microsoft Visual Basic MVP -

WWW: Http://www.mvps.org/EDais/

 
 
 

DIB to DX8 Display

Post by Joe » Tue, 01 Jul 2003 00:12:52



> > I need to take a DIB created from a JPEG decode (using IJL lib) and
> > display it using DX8 (or 7 or 9)

> > In Win API BITBLT, speed is OK. STRETCHBLT for larger display
> > requestes(Blow up to fullscreen,etc) it is horrendously slow

> > DX8 funcion that loads a JPEG from file is pitifully slow under DX8,
> > and the JPEG source is from the wire, never on a disk file

> > VB6 code snippet that works ( and is faster than BIT/BLT And
> > StretchBLT) will be rewarded. Looking for speed similar to Media
> > player full screen speeds.

> You'd probably be better off posting this to a DirectX group, this groups
> tends to deal more with VB and GDI problems, with that in mind here's a few
> things that you could try (I've only done a little DX development in the
> past though, and never dealt with this directly before so exactly how
> helpful this will be, I don't know..)
> Create your texture using CreateTexture(), and make sure you specify only 1
> level so it doesn't spend unnecessary time creating all the mip-maps for
> you.  You may not be able to create this texture at the same size as your
> original image though due to the limitations of the hardware (Many require
> sizes in powers of two and/or square textures) so you'll have to check the
> TextureCaps of the device to see what you can get away with there.  Once
> you're created it you can use GetSurfaceLevel() to get a pointer to the
> surface data then LockRect() to get access to the memory block that
> comprises the texture data.  Write your image scanline into this one by one
> (If you use the IJG library then you can probably get it decompress it's
> data directly to this area for extra speed) taking care to get your scans
> lines up and at the same depth (And channel order!) as the surface
> requires - Be aware that the scans are most likely not going to be stored
> contiguously because the Pitch of the texture is likely not the same as the
> width.  when you're done, UnlockRect() to set the data and you've got a
> texture to draw with.  Now all you need to do is SetTexture() this and draw
> your mesh data (Make sure you've got texture coordinates and ambient
> lighting in your vertex definitions though.)
> Hope this helps,

>     Mike

>  - Microsoft Visual Basic MVP -

> WWW: Http://www.mvps.org/EDais/

Mike, Thnaks for the Info. I need a framework or pseudo code(real code
would be best!)
I found this link that is it,
http://www.gamedev.net/reference/articles/article1305.asp
but the function DDCopyBitmap cant be found in DX7or DX8 type
library... and help on this?

Thanks

joe

 
 
 

DIB to DX8 Display

Post by Schmid » Thu, 03 Jul 2003 06:29:48



> I need to take a DIB created from a JPEG decode (using IJL lib) and
> display it using DX8 (or 7 or 9)

You can look at the DX7-example here:
http://groups.google.de/groups?q=vb+sss+blending+twice

It shows, how to deal with InMemory-Surfaces.
Especially the (Un-)LockArray-Calls are interesting - you could decompress
with IJL against the VarPtr(LockedArray(0,0)) without problems on 24Bit- or
32Bpp-Screens.

Olaf

 
 
 

1. No display update in Dx8 program

Hi all,

I have the following problem with a DX8 program (Windows XP, Visual C++ 6.0,
GeForce 2 GTS Pro, several drivers tested but same problem):
It runs fine until another program using DX8 has been executed (a 3D game
for example). If I run my program after playing a 3D game, it just displays
the first frame (without any error) and doesn't update the display any
further. The same frame stays on the window even if I move or resize it. My
computer becomes very slow until I close my program. If I reboot my computer
and run my program again, it works perfectly and shows spinning 3D solids.

Any idea?
Thanks,

- Stphane Messerli

2. Lightwave Vs 3DS MAX Vs truespace

3. RenderFieryText() not display in DX8.1 example

4. Text in OpenGL

5. m_pGameFont->DrawTextScaled() not display text in DX8.1

6. Dib Displaying in Windows

7. Displaying a DIB

8. Dll returns a Handle to a DIB how can I display in picture box

9. Displaying DIB's

10. displaying 24 bits DIB bitmap

11. Need Help Creating and Displaying a DIB