Maybe this one belongs in the beginners section because it's fairly obvious.
I wanted to load a large JPG image and display it on the screen.
We have the command LoadImage() but not LoadJPGImage().
However, if you have DirectX the following works:
Code: Select all
;load and display a JPG file
InitSprite()
OpenWindowedScreen(WindowID(1),0,0,1,1,0,0,0);1 pixel screen
LoadJPEGSprite(1,"c:\pic.jpg",#PB_Sprite_Memory)
SaveSprite(1,"c:\pic.bmp")
FreeSprite(1)
CloseScreen()
StartDrawing(WindowOutput())
LoadImage(1,"c:\pic.bmp")
DrawImage(UseImage(1),0,0)
StopDrawing()
This works OK for large images and is quite fast.
You seem to be able to do this repeatedly without problems.
Anyone see any problem with this, or know a better way?