MDIGadget and tiled image

Just starting out? Need help? Post your questions and find answers here.
Mesa
Enthusiast
Enthusiast
Posts: 345
Joined: Fri Feb 24, 2012 10:19 am

MDIGadget and tiled image

Post by Mesa »

Tiled image attribute seems to be buggy.

Uncomment line 22 and it works now.

Code: Select all

#Main = 0
#MDIChild = 1

If CreateImage(0, 256, 256, 32, RGB(255,255,255))
      StartDrawing(ImageOutput(0))
      Ellipse(70, 50, 30, 10, RGB(0,0,255))
      Ellipse(186, 50, 30, 10, RGB(0,0,255))
      LineXY(128, 80, 128, 150, RGB(255, 0, 255))
      RoundBox(70, 200, 110, 30, 20, 20, RGB(255, 0, 0))
      StopDrawing()
    EndIf


  If OpenWindow(#Main, 0, 0, 400, 300, "MDIGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget)
    If CreateMenu(#Main, WindowID(#Main))
      MenuTitle("Menu index 0")
      MenuTitle("MDI windows menu")
        MenuItem(0, "self created item")
        MenuItem(1, "self created item")

        MDIGadget(0, 0, 0, 0, 0, 1, 2, #PB_MDI_AutoSize)
;         SetGadgetAttribute(0,#PB_MDI_Image,ImageID(0)); uncomment this line and the tiled image is ok
        SetGadgetAttribute(0,#PB_MDI_TileImage,ImageID(0))

        
        AddGadgetItem(0, #MDIChild, "child window")
          ; add gadgets here...
      UseGadgetList(WindowID(#Main)) ; go back to the main window gadgetlist
    EndIf
    Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
  EndIf
M.
breeze4me
Enthusiast
Enthusiast
Posts: 511
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: MDIGadget and tiled image

Post by breeze4me »

No, it's not a bug.
You seem to have misunderstood the setting value.
#PB_MDI_TileImage: Set the tile mode. 0 draws the image just once in the top/left corner, 1 repeats the image to fill the whole area
It should be...

Code: Select all

SetGadgetAttribute(0,#PB_MDI_Image,ImageID(0))
SetGadgetAttribute(0,#PB_MDI_TileImage, 1)      ;   <---- "1"
Post Reply