I use PB 3.92 for Linux and I try to show images in a window. But nothing appears. I tried with DrawImage (apparently supported now) and also with an ImageGadget but both methods not work. How can we do
How to show images ?
How to show images ?
Hi all,
I use PB 3.92 for Linux and I try to show images in a window. But nothing appears. I tried with DrawImage (apparently supported now) and also with an ImageGadget but both methods not work. How can we do
It works fine on the Windows version.
I use PB 3.92 for Linux and I try to show images in a window. But nothing appears. I tried with DrawImage (apparently supported now) and also with an ImageGadget but both methods not work. How can we do
PureBasic: one of the best programming tools ever ! PB is light, easy, crossplatform, powerfull, fast, extendable, enjoyable and... tasty 
-
olejr
- Enthusiast

- Posts: 152
- Joined: Sun Jul 11, 2004 7:48 pm
- Location: Lillehammer, No(r)way
- Contact:
@Fred: sure..
When you try to run it on desktop < 24bit.. It gives:
Gdk-ERROR ** : BadMatch (invalid parameter attributes) serial 52 error_code 8 request_code 147 minor_code 3
Gdk-ERROR ** : BadMatch (invalid parameter attributes) serial 53 error_code 8 request_code 147 minor_code 3
And the first time i came over this, i did report it in the bug section..
viewtopic.php?t=11727&highlight=
Code: Select all
LoadImage(1,"logo.bmp") ; renamed PB logo
OpenWindow(0,0,0,200,187,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Linux Image Gadget")
CreateGadgetList(WindowID())
ImageGadget(0,0,0,200,187,UseImage(1))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindowGdk-ERROR ** : BadMatch (invalid parameter attributes) serial 52 error_code 8 request_code 147 minor_code 3
Gdk-ERROR ** : BadMatch (invalid parameter attributes) serial 53 error_code 8 request_code 147 minor_code 3
And the first time i came over this, i did report it in the bug section..
viewtopic.php?t=11727&highlight=
I give another sample with jpeg and SetGadgetState. I am in 24bits color too and I do not get any error messages. Just a blank window without image.
Code: Select all
Enumeration
#frmMain
#imgMain
EndEnumeration
UseJPEGImageDecoder()
OpenWindow(#frmMain, 50, 50, 500, 450, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_ScreenCentered, "ImageViewer")
CreateGadgetList(WindowID(#frmMain))
ImageGadget(#imgMain, 0, 0, 500, 450, 0)
If LoadImage(1, "test.jpg")
SetGadgetState(#imgMain, UseImage(1))
Else
MessageRequester("Error", "Cannot load the image !")
EndIf
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_Event_CloseWindow
End
PureBasic: one of the best programming tools ever ! PB is light, easy, crossplatform, powerfull, fast, extendable, enjoyable and... tasty 
Any news about this, Fred ? We know you are working on the Windows version for now but can we expect to be solved soon if it is not a major bug ? It is blocking issue on the project I am working on. 
PureBasic: one of the best programming tools ever ! PB is light, easy, crossplatform, powerfull, fast, extendable, enjoyable and... tasty 
Hi Fred,
I tried the new libraries (Image and Gadget) available in beta/linux. The direct image allocation in the ImageGadget() function works now. Thanks for it.
But it does not work yet when you try to set another image by using the SetGadgetState() function. It would be nice if you could solve it too.
I tried the new libraries (Image and Gadget) available in beta/linux. The direct image allocation in the ImageGadget() function works now. Thanks for it.
PureBasic: one of the best programming tools ever ! PB is light, easy, crossplatform, powerfull, fast, extendable, enjoyable and... tasty 
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
Hi,
I tested the linux/beta libs and get some errors when I try to display ImageGadget or ButtonImageGadget
my display is 24 bit cause the 16 bit bug, but now it seems it should be 32 bit???
the image is an indexed (256 color) bmp!
I´m using the -s gtk2 switch for compiling
I tested the linux/beta libs and get some errors when I try to display ImageGadget or ButtonImageGadget
Code: Select all
(<unknown>:1892): Gdk-WARNING **: The gdk_draw_*_image require the drawable argument to
have a specified colormap. All windows have a colormap,
however, pixmaps only have colormap by default if they
were created with a non-NULL window argument. Otherwise
a colormap must be set on them with gdk_drawable_set_colormap
(<unknown>:1892): Gdk-WARNING **: Attempt to draw a drawable with depth 32 to a drawable with depth 24
the image is an indexed (256 color) bmp!
I´m using the -s gtk2 switch for compiling
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
the image example from purebasic does the same error!
Any hint?
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Image example file
;
; (c) 2001 - Fantaisie Software
;
; ------------------------------------------------------------
;
If OpenWindow(0, 100, 100, 300, 300, #PB_Window_SystemMenu, "PureBasic - Image")
Gosub CreateImage
CreateGadgetList(WindowID())
ImageGadget(0, 10, 10, 100, 100, ImageID())
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_EventCloseWindow ; If the user has pressed on the close button
EndIf
End ; All the opened windows are closed automatically by PureBasic
;
; Some 2D graphics functions...
;
CreateImage:
If CreateImage(0, 255, 255)
If StartDrawing(ImageOutput())
For k=0 To 255
FrontColor(k,0, k) ; a rainbow, from black to pink
Line(0, k, 255, 0)
Next
DrawingMode(1)
Locate(40, 50)
FrontColor(255,255,255) ; print the text to white !
DrawText("An image created easely...")
StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
EndIf
EndIf
Return
Code: Select all
(<unknown>:1952): Gdk-WARNING **: Attempt to draw a drawable with depth 32 to a drawable with depth 24
count = 1
-
bender-rulez
- User

- Posts: 49
- Joined: Mon Mar 14, 2005 11:30 am
