FBGUI library for windows 2

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 04, 2017 23:07

OK.

I am trying to read the pixel values inside a movie player. I have been unable to do this successfully with PureBasic. We'll see how it goes with FB.
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 05, 2017 6:10

D:\Programs\FreeBASIC\bin\win32\ld.exe: cannot find -lwindow9

Now what?
D.J.Peters
Posts: 7494
Joined: May 28, 2005 3:28

Re: FBGUI library for windows 2

Postby D.J.Peters » Oct 05, 2017 8:35

it's all include in LIBFB.zip
download: LIBFB.zip

In the case your russian are not perfect here are the Window9 help in english ;-)
download: helpWindow9en.zip


move\copy the 3 *.a files to the FreeBASIC\lib\win32
move\copy the 3 *.bi files to the FreeBASIC\inc

thats all

Joshy
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 05, 2017 10:50

To compile, copy these three files to the folder FreeBASIC\inc

zlib.bi
Window9.bi
Linked_Lists.bi

Copy these three files to the folder FreeBASIC\lib\win32

libwindow9.a
libLinked_Lists.a
libz.a
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 05, 2017 11:29

I got it to compile without error, thank you.

The function LoadMovie() does not open a movie file with a literal string, viz.:

Code: Select all

mov8=loadmovie(GadgetID(4),"mymovie.mp4",0,0,WindowWidth(hwnd)-30,WindowHeight(hwnd)-110)


The volume function does not work:

Code: Select all

MovieAudioSetVolume (mov8, -1000)
VANYA
Posts: 1273
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Oct 05, 2017 18:42

chris319 wrote:I got it to compile without error, thank you.

The function LoadMovie() does not open a movie file with a literal string, viz.:

Code: Select all

mov8=loadmovie(GadgetID(4),"mymovie.mp4",0,0,WindowWidth(hwnd)-30,WindowHeight(hwnd)-110)


The volume function does not work:

Code: Select all

MovieAudioSetVolume (mov8, -1000)


Only now I checked on the systems:

windows 7 32 bit
windows 10 64 bit (32-bit compilier)

Everything works fine. The volume is also adjustable. You are doing something wrong. Perhaps you incorrectly specified the path to the file. With loudness, there can be problems only if you have incorrect codecs. Try it on another file.
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 05, 2017 23:24

Perhaps you incorrectly specified the path to the file.


If that were the problem the movie would not load and play, which it does. I can control the volume on the same file on the same machine using the PureBasic player so I doubt the problem is with my machine or the codecs or the file.
VANYA
Posts: 1273
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Oct 06, 2017 6:12

Please, participants of the forum, who has the library installed: please check the participant's approval chris319.

chris319! I ask to lay out in the archive [not working code + movie] , without violating the licenses movie.
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 06, 2017 23:15

chris319! I ask to lay out in the archive [not working code + movie] , without violating the licenses movie.


Hi VANYA -

Where does one find this archive? Is it on SourceForge?

I got the movie volume function to work. Sorry for any misunderstanding.

I am also working with the movie snapshot function. It is very useful to me.
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 06, 2017 23:44

chris319! I ask to lay out in the archive [not working code + movie] , without violating the licenses movie.


Hi VANYA -

Where does one find this archive? Is it on SourceForge?

I got the movie volume function to work. Sorry for any misunderstanding.

I am also working with the movie snapshot function. It is very useful to me.
VANYA
Posts: 1273
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Oct 07, 2017 4:49

chris319 wrote:Where does one find this archive? Is it on SourceForge?


You did not understand me. I asked you to put the project (not working code + any movie) so that I or other forum members could check whether you did everything correctly in the code.

chris319 wrote:I got the movie volume function to work. Sorry for any misunderstanding.


Well, what about this statement:

chris319 wrote:The function LoadMovie() does not open a movie file with a literal string, viz.:

Code: Select all
mov8=loadmovie(GadgetID(4),"mymovie.mp4",0,0,WindowWidth(hwnd)-30,WindowHeight(hwnd)-110)


Happened to specify a string of type: "mymovie.mp4" ?
chris319
Posts: 111
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Postby chris319 » Oct 07, 2017 8:44

Well, what about this statement:

chris319 wrote:
The function LoadMovie() does not open a movie file with a literal string, viz.:

Code: Select all
mov8=loadmovie(GadgetID(4),"mymovie.mp4",0,0,WindowWidth(hwnd)-30,WindowHeight(hwnd)-110)



Happened to specify a string of type: "mymovie.mp4" ?


That works now, too.
enform
Posts: 158
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for windows 2

Postby enform » Mar 05, 2018 10:29

Hello ,
I'm playing a bit with 2D_Draw . I just added 1 WindowStartDraw ( WSD ) and 1 or 2 ImageStartDraw ( ISD1 & ISTD2 ) .
I can move or comment the code of the 2 ISDn before or after WSD .
When ISD1 and/or ISD2 are moved before WSD , all is displayed , but when WSD is in the first place , it is not displayed ;
only ISD1 and/or ISD2 are .
This is my problem ... A solution , dear FbMen ? Thanks .

Code: Select all

 
#Include Once "window9.bi"
 
Type w0
   As HWND hwnd_0
   Declare Sub Sub_1( )  '  Button  :  Button1
   Declare Sub Sub_2( )  '  Button  :  Button2
   Declare Function OpenWindow_0() As HWND
End Type

' Dim
   Dim As w0 win0
' End Dim

 
Function w0.OpenWindow_0() As HWND
   hwnd_0 = OpenWindow("Win0",10,10,500,600)
   WindowColor(hwnd_0,BGR(240,240,240))
   SetGadgetFont(,CInt(LoadFont("Courier New",10)))
   'WindowBounds(hwnd_0,500,300,500,300)
   Var HIMAGE = Load_Icon(ExePath + "\*.ico")
   SendMessage(hwnd_0,WM_SETICON,ICON_BIG,Cast(LPARAM,HIMAGE))
   UseGadgetList(hwnd_0)
   ButtonGadget(1,230,200,70,200,"Button1")
   SetGadgetFont(1,CInt(LoadFont("Tahoma",9)))
 
   ButtonGadget(2,230,410,70,20,"Button2")
   SetGadgetFont(2,CInt(LoadFont("Tahoma",9)))
   CheckBoxGadget(3,320,380,120,50,"Chk3")
   SetGadgetFont(3,CInt(LoadFont("Tahoma",9)))
   SetGadgetColor(3,BGR(220,220,220),BGR(0,0,0),3)
   
 
   Return hwnd_0
End Function
 
win0.hwnd_0 = win0.OpenWindow_0()
 
Sub w0.Sub_1( )  '  Button  : Button1
   ' Static As Long
   ' Static As   
 
End Sub
 
Sub w0.Sub_2( )  '  Button  : Button2
   ' Static As Long
   ' Static As   
 
End Sub
 
 
' endcode w0
 
 
 
' code MAIN
 ' ISD1
   ' place  Create_Image  just before  ImageStartDraw  for a good parsing
   Var hbitmap = Create_Image(120,140)
   ImageStartDraw(hbitmap)
   FillRectDraw(10,10,&h557788)
   CircleDraw(25,30,20,255,255)
   BoxDraw(10,70,30,30,125)
   StopDraw
   
   ImageGadget(4,0,320,120,140,hbitmap)
 
 ' ISD2
   Var hbitmap1 = Create_Image(120,140)
   ImageStartDraw(hbitmap1)
   FillRectDraw(10,10,&h557788)
   CircleDraw(25,30,20,255,255)
   BoxDraw(10,70,30,30,125)
   StopDraw
   
   ImageGadget(5,150,320,120,140,hbitmap1)

' WSD
   WindowStartDraw(win0.hwnd_0,0,0,500,300,,)
   FillRectDraw(10,10,&h887755)
   'BoxDraw(10,10,100,100,125)
   CircleDraw(10,10,60,255,255)
   RoundDraw(140,20,55,60,200,1671940,20)
   RoundBoxDraw(265,90,110,110,100,220,,,1005,240)
   PieDraw(70,70,80,80,170,60,60,130,255,&hff0000,2)
   LineDraw(205,60,420,160,15,155)
   TextDraw(30,90,"Hello AZERTY",240,50)
 
 
   Dim pPoint0(3) As Point
   pPoint0(0).x = 445
   pPoint0(0).y = 30
   pPoint0(1).x = 165
   pPoint0(1).y = 125
   pPoint0(2).x = 150
   pPoint0(2).y = 200
   PolylineDraw(@pPoint0(0),3,&hD24EF3)
 
   Dim pPoint1(3) As Point
   pPoint1(0).x = 35
   pPoint1(0).y = 140
   pPoint1(1).x = 150
   pPoint1(1).y = 150
   pPoint1(2).x = 110
   pPoint1(2).y = 200
   PolygonDraw(@pPoint1(0),3,&hD24EF3)         
 
   StopDraw
 
 ' if this part is commented , WindowStartDraw(win0.hwnd_0 .... is displayed
 ' if this part is uncommented , WindowStartDraw(win0.hwnd_0 .... is not displayed
 ' if the first ImageStartDraw(hbitmap) .... is commented and the following hbitmap1 is uncommented ,
 ' all is displayed .
 
   ' place  Create_Image  just before  ImageStartDraw  for a good parsing
   'Var hbitmap1 = Create_Image(120,140)
   'ImageStartDraw(hbitmap1)
   'FillRectDraw(10,10,&h557788)
   'CircleDraw(25,30,20,255,255)
   'BoxDraw(10,70,30,30,125)
   'StopDraw
   '
   'ImageGadget(5,150,320,120,140,hbitmap1)
 
 
   
' endcode MAIN
 
Do
   Var event = WaitEvent
   Select Case event
      Case WM_SIZE
      Case EventClose
         Exit Do     ' End
      Case EventMenu
         Select Case EventNumber
            Case 1000
         End Select
      Case EventGadget
         Select Case EventNumber
            Case 1      '  Button : Button1
               win0.Sub_1( )
            Case 2      '  Button : Button2
               win0.Sub_2( )
         End Select
         Select Case EventNumberToolBar
            Case 9999
         End Select
   End Select
Loop
'

VANYA
Posts: 1273
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Mar 06, 2018 4:07

Hi enform!

Drawing with WindowStartDraw (drawing on the window) should be supported by the programmer. This is done in a cycle or a timer.

example 1:

Code: Select all

#Include "window9.bi"

Var hwnd = OpenWindow("",10,10,500,500)

Do

   Var event = WindowEvent
   
   WindowStartDraw(hwnd)

    CircleDraw(50,50,50,255,255)
   
   StopDraw
   
   Sleep(1)

   If event = eventclose Then Exit Do

Loop


example 2:

Code: Select all

#Include "window9.bi"

Dim Shared As HWND hwnd

hwnd = OpenWindow("",10,10,500,500)

Sub draw_()
   
   WindowStartDraw(hwnd)

    CircleDraw(50,50,50,255,255)
   
   StopDraw   
   
End Sub

SetTimer(hwnd,1,10,@draw_())

Do

   Var event = WaitEvent

   If event = eventclose Then Exit Do

Loop

KillTimer(hwnd,1)
enform
Posts: 158
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for windows 2

Postby enform » Mar 06, 2018 9:45

Thank you Vanya ; in events or timer !

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 2 guests