Image. Is possible to add one?
-
- Posts: 375
- Joined: Mar 15, 2015 12:41
Image. Is possible to add one?
Hi people!
Is possible to put an image loaded from somewhere as a background in the screen?
Thanks.
Is possible to put an image loaded from somewhere as a background in the screen?
Thanks.
Re: Image. Is possible to add one?
Sure, no problem ... (only: if you overwrite the IMG, then clear it, you'll have to:
Put the IMG first again, before new overwrite)
Put the IMG first again, before new overwrite)
Re: Image. Is possible to add one?
Without other libraries it is only possible to load and save .bmp:
Code: Select all
Screen 19, 32
Dim As Any Ptr bild
Dim As String datei
Dim As Integer breite, hoehe
datei = "DeinBild.bmp"
breite = 467
hoehe = 236
bild = ImageCreate(breite, hoehe, 0)
BLoad datei, bild
Put (100, 100), bild, PSet
Sleep
ImageDestroy(bild)
-
- Posts: 375
- Joined: Mar 15, 2015 12:41
Re: Image. Is possible to add one?
Thanks! I´ll try it tomorrow! :-)
-
- Posts: 375
- Joined: Mar 15, 2015 12:41
Re: Image. Is possible to add one?
Nice, works perfect! :-)
I have a problem now.
If I maximized the window, I have now way to minimize it again.
How to do it or directly to not allow to maximize it?
Thanks!
I have a problem now.
If I maximized the window, I have now way to minimize it again.
How to do it or directly to not allow to maximize it?
Thanks!
Re: Image. Is possible to add one?
I wonder how you can maximize. Here it is only possible to minimize. Because Screen 19 means fixed size 800 x 600. Better use Screenres with desired resolution. See docs for all the possibilities. Simply replace Screen 19,32 with Screenres 1024,768, 32 or similar. Note the picture should change with the choosen colordepth. If you want full screen you could use:Luis Babboni wrote:If I maximized the window, I have now way to minimize it again.
How to do it or directly to not allow to maximize it?
Code: Select all
#Include "fbgfx.bi"
Dim as Integer swidth, sheight
Dim As Any Ptr bild
Dim As String datei
Dim As Integer breite, hoehe
SCREENCONTROL FB.GET_DESKTOP_SIZE, swidth, sheight
IF SCREENRES(swidth, sheight,32,,FB.GFX_NO_FRAME or FB.GFX_ALWAYS_ON_TOP) THEN
PRINT "Fehler: Grafikfenster konnte nicht initialisiert werden!"
SLEEP
END
END If
datei = "ma002.bmp"
breite = 467
hoehe = 236
bild = ImageCreate(breite, hoehe, 0)
BLoad datei, bild
Put (100, 100), bild, PSet
Sleep
Re: Image. Is possible to add one?
If you don't care about Linux compatibility you can use GDIPlus to load / save in various image formats.
Re: Image. Is possible to add one?
There are a lot of libraries who can load more graphics formats. Depending what you are planning to work on. Naturally if you are italian you will choose a library with good italian docs.
Re: Image. Is possible to add one?
The simplest way to use multiple file formats (loading, incl. .PNG saving) and,
still staying multi platform, is:
FBImage, from "Libraries" section of forum ... (by D.J.Peters, aka: Joshy)
still staying multi platform, is:
FBImage, from "Libraries" section of forum ... (by D.J.Peters, aka: Joshy)
-
- Posts: 375
- Joined: Mar 15, 2015 12:41
Re: Image. Is possible to add one?
I have no problem with ,bmp, is fine for me.
What I try to do and could not is to avoid the possibilitie that someone click by mistake in "enlarge the screen" (the square at the left of the cross to close window). Or if it is not possible to avoid it, be able to return to the orginal size.
What I try to do and could not is to avoid the possibilitie that someone click by mistake in "enlarge the screen" (the square at the left of the cross to close window). Or if it is not possible to avoid it, be able to return to the orginal size.
Re: Image. Is possible to add one?
You can do it setting the 'gfx_no_switch' flag, defined in 'fbgfx.bi', in the call to screenRes. Like this:Luis Babboni wrote:I have no problem with ,bmp, is fine for me.
What I try to do and could not is to avoid the possibilitie that someone click by mistake in "enlarge the screen" (the square at the left of the cross to close window). Or if it is not possible to avoid it, be able to return to the orginal size.
Code: Select all
#include once "fbgfx.bi"
screenRes( 800, 600, 32, , fb.gfx_no_switch )
sleep()
-
- Posts: 375
- Joined: Mar 15, 2015 12:41
Re: Image. Is possible to add one?
Nice! Thanks Paul!
Re: Image. Is possible to add one?
My pleasure.Luis Babboni wrote:Nice! Thanks Paul!