Simple fast image drawing


#1

I have a little movie preview component, however image drawing in juce is quite slow for this purpose.

I need to move an image to the screen quickly. I don’t need to blend it, it can be platform specific. (windows…)

Has anyone accomplished this?

I have tried to use the WindowsBitmapImage with no success.

VideoComponent::paint(Graphics &g)
{

		RectangleList rl;
		WindowsBitmapImage *image = new WindowsBitmapImage(mImage->getFormat(),mImage->getWidth(),mImage->getHeight(),true);
		Graphics *offg = new Graphics(*image);
		offg->drawImageAt(mImage,0,0);
		delete offg;

image->blitToWindow((HWND)getWindowHandle(),GetDC((HWND)getWindowHandle()),true,0,0,rl);

}

Any ideas, suggestions?

Thanks!
dan


#2

I think that Windows has some ancient bodge for doing that kind of stuff, but I’ve never tried it. VFW, I think it’s called.


#3

I guess DirectShow would be more appropriate.
You could also perform your rendering in OpenGL (which is what most of the video player do those days, mainly because of native YUV format) or DirectX.


#4

Although VFW is ancient it is simple and fast. We are developing vj software and we swear by VFW. We use VFW and OpenGL for displaying.
DirectShow is hard to get comfortable with, of course you can do much more with it then VFW and for other purposes it is great but if you just want to playback .avi files use VFW.

Here is a simple OpenGlL VFW example.
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35

Edwin