Click to See Complete Forum and Search --> : blitting jpg's in DirectX 7
ca9mbu
Sep 6th, 2000, 05:51 AM
OK, I've managed to blit .bmps very easily in DirectX 7.0a, using the CreateSurfaceFromRes() function. Now instead of converting the jpgs I actually wanna display into bmps I just wanna be able to blit them in a similar way. I tried passing the name of a .jpg file to the function but it says "file not found", which I think is it's way of saying to me I'm expecting too much! :)
So Q1 is how do I blit jpgs using DirectX?
Question 2 is I want to display these images over the top of the Geiss Screensaver or Winamp Plugin. As far as I know this uses DirectX to gain access to the screen, and I would imagine it's done in exclusive mode. I assume this means that I wouldn't be able to blit my stuff to the screen at the same time, or would I?
Thanx for any help
Matt
/\/\isanThr0p
Sep 6th, 2000, 02:13 PM
Q1: You can't blit JPG! You have to convert them in something like the PictureBox and then do BltFromDC (or similar)
Q2: At first I thought that this would be totally impossible, but I think there is a way.
You got to search the Primary surface of Geiss. If it would be in Systemmemory it would be hard, but I guess it is in VideoMem so it is nearly impossible. (nearly) I don't know how you could get the DC but it should be possible.
But: Even if you succeed It will flicker, because you are writing to the frontbuffer! writing to the backbuffer shouldn't be a good idea, because you'd never know if it will be overwritten or not!
Another way would be to get a real strong always on top Window. I saw something like this, but I forgot what it was (try ICQ) but I never succeed doing something like this.
sorry for my English
kedaman
Sep 7th, 2000, 08:03 AM
CreatesurfacefromDC is also alvalable, you load the jpg into a picturebox and create a surface from it.
I'm sceptic about the idea of blitting to a foreign app surface just from the memory, maybe you could ask the creator if he could make the plugin extendable with activeX...
ca9mbu
Sep 7th, 2000, 08:46 AM
Thanx for your help on this.
WRT your suggestion of asking the creator to extend his plugin I'm still awaiting his reply to my last email (around December last year!) regarding his plugin crashing without good cause. So I would think it extremely unlikely he's gonna respond to this one. And if he did respond I'd ask him to just do this himself...the .ini file lets you store custom messages, so it should be pretty easy to let you store paths to .bmp/.jpg/.whatever files to display on screen as well.
I'll give your suggestions regarding the picturebox a try anyway.
Matt
KENNNY
Sep 9th, 2000, 06:57 PM
or if you dont want nasty picboxes, find some manual jpeg loading code. btw i havent a clue how to do it ;)
HarryW
Sep 9th, 2000, 08:31 PM
Not sure if this is going to be useful, but there's some jpeg stuff here: http://vbaccelerator.com/codelib/gfx/vbjpeg.htm
I think it lets you load your jpeg into a byte array or something.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.