Page 1 sur 1

couleur sur StartDrawing()

Publié : mar. 01/janv./2008 23:31
par venom
bonsoir, voila je voie que dans l'aide de purebasic c'est notée que :
La couleur d'arrière plan est le noir (ie: RGB(0,0,0)) et la couleur d'avant plan est le blanc (ie: RGB(255,255,255)).
et il n'existe pas de fonction permettant de changer la couleur de fond d'un StartDrawing() ????
exemple:

Code : Tout sélectionner

If OpenWindow(0, 100, 200, 300, 200, "2D Drawing Test")

  If CreateImage(0, 300, 200)
    If StartDrawing(ImageOutput(0))

      BackColor(RGB(0,0,0))
      FrontColor(RGB(255,255,255)) 
      DrawText(10,50,"changer le fond actuellement noir ?")

      StopDrawing()
    EndIf
  EndIf
 
  CreateGadgetList(WindowID(0))
    ImageGadget(0, 0, 0, 0, 0, ImageID(0))

  Repeat
    EventID = WaitWindowEvent() 
  Until EventID = #PB_Event_CloseWindow 
  
EndIf



@++

Publié : mer. 02/janv./2008 0:06
par Chris
En principe, non. Il faut dessiner une boite sur toute la surface de ton image, avec la couleur que tu veux.

Code : Tout sélectionner

If OpenWindow(0, 100, 200, 300, 200, "2D Drawing Test")
  
  If CreateImage(0, 300, 200)
    If StartDrawing(ImageOutput(0))
      
      ; BackColor(RGB(0,0,0))
      ; FrontColor(RGB(255,255,255)) 
      
      Box(0, 0, 300, 200, $FF0000)
      DrawingMode(#PB_2DDrawing_Transparent)
      FrontColor($00FFFF)
      
      DrawText(10,50,"changer le fond actuellement noir ?")
      
      StopDrawing()
    EndIf
  EndIf
  
  CreateGadgetList(WindowID(0))
  ImageGadget(0, 0, 0, 0, 0, ImageID(0))
  
  Repeat
    EventID = WaitWindowEvent()
  Until EventID = #PB_Event_CloseWindow
  
EndIf

Publié : mer. 02/janv./2008 12:02
par venom
ok je te remercie, sa ma traverser l'esprit cette nuit, maintenant je sais que c'est bien sa :wink:


@++