gui graphic

BlitzPlus Forums/BlitzPlus Beginners Area/gui graphic

o-q(Posted 2007) [#1]
I will probably get shot down for this, but......

is it possible to use a picture with a gui?

ie to have a graphic sitting on or in the interface?


CS_TBL(Posted 2007) [#2]
Didn't test, but I estimate it should just work..

window=CreateWindow("window",0,0,640,480)

canvas=CreateCanvas(0,0,640,480,window)

image=LoadImage("c:\image.jpg")

SetBuffer CanvasBuffer(canvas)
	DrawImage image,0,0
FlipCanvas canvas

Repeat
	WaitEvent()
	If EventID()=$803 End
Forever


So, the bottomline: draw an image onto a canvas!


Adam Novagen(Posted 2007) [#3]
Actually, I have a question on this topic: Is it possible to change the appearance of standard windows buttons? I.E., could I make an "OK" button, that was an official BUTTON gadget, from an external image? Also, is it possible to change the appearance of the minimize/maximize/close buttons on the title bar?


matthew(Posted 2007) [#4]
I'm not sure drawing the image works I tried your program and after changing loadimage("C:\image.bmp") to one of my own images it said invalid "image handle"


CS_TBL(Posted 2007) [#5]
Can't test here atm, I'm remote only carrying my notebook with BMax on it.


Andy_A(Posted 2007) [#6]
CS_TBL's code works fine.

Make sure you copy the image into the folder where you are running the test code, or use the "full path and file name" for the image you are loading.


CS_TBL(Posted 2007) [#7]
ye olde imageloader with check:

Function LoadImage2(file$)
  image=LoadImage(file$)
  If Not image RuntimeError "Image "+file$+" not found."
  Return image
End Function



Andres(Posted 2007) [#8]
Try this: http://www.f-once.pri.ee/temp/gui.rar
It needs API decls in your blitz+!

Screenshot: