Hello.
I've a strange bug with my drawing program. See the attached file to see the problem. Some white lines...
My config : 1600x900 px, windows 7, amd radeon 7400 serie 1Go DDR2 . i've updated the radeon video driver and directX.
Note, if i move the agk windows on the Win7 deskstop, the problem occur at the same location, seems to be after the Y vertical center ?
I post also an extract of my code (line 237) . Thanks fo you help.
// Project: Borne_ehpad_agk
// Created: 2017-11-29
// By : Hubert BAYRE.
//-------------------------------------------------------------------------------------------------------------------------
//
// DESSIN
//
//-------------------------------------------------------------------------------------------------------------------------
Global Dessin_sprite_fond_ecran as Integer
Global Dessin_couleur as Integer
Global Dessin_taille_pinceau as Integer
Type DessinZoneType
Id as Integer
x as Integer
y as Integer
Largeur as Integer
Hauteur as Integer
EndType
Global Dessin_tableau_zones as DessinZoneType[]
Global Dessin_etat_jeu as Integer
Global Dessin_render_image as Integer
Global Dessin_sprite_render_image as Integer
Global Dessin_son_enregistrement as Integer
//-------------------------------------------------------------------------------------------------------------------------
//
// FONCTIONS
//
//-------------------------------------------------------------------------------------------------------------------------
Function Dessin_ajouter_zone (Id as Integer, Texte as String, x as Integer, y as Integer, Largeur as Integer, Hauteur as Integer)
Local z as DessinZoneType
z.Id = Id
z.x = x
z.y = y
z.Largeur = Largeur
z.Hauteur = Hauteur
Dessin_tableau_zones.Insert (z)
Endfunction
Function Charger_jeu_dessin()
Local Image as Integer
Dessin_ajouter_zone (1,"Point1", 1402,95,81,50)
Dessin_ajouter_zone (2,"Point2", 1402,155,81,50)
Dessin_ajouter_zone (3,"Point3", 1402,225,81,50)
Dessin_ajouter_zone (4,"Point4", 1502,95,81,50)
Dessin_ajouter_zone (5,"Point5", 1502,155,81,50)
Dessin_ajouter_zone (6,"Point6", 1502,225,81,50)
Dessin_ajouter_zone (7, "Rouge", 1402,362,80,55)
Dessin_ajouter_zone (8, "Bleu", 1402,430,80,55)
Dessin_ajouter_zone (9, "Magenta", 1402,492,80,55)
Dessin_ajouter_zone (10, "Noir", 1402,562,80,55)
Dessin_ajouter_zone (11, "Vert", 1492,362,80,55)
Dessin_ajouter_zone (12, "Jaune", 1492,430,80,55)
Dessin_ajouter_zone (13, "Cyan", 1492,492,80,55)
Dessin_ajouter_zone (14, "Blanc", 1492,562,80,55)
Dessin_ajouter_zone (15, "Effacer", 1402,643,280,66)
Dessin_ajouter_zone (16, "Enregistrer", 1402,733,280,66)
Dessin_ajouter_zone (17, "Quitter", 1402,817,280,66)
Dessin_taille_pinceau = 4
Dessin_couleur = MakeColor (0,0,0)
Dessin_render_image = CreateRenderImage (1600,900,0,0)
Dessin_sprite_render_image = CreateSprite (Dessin_render_image)
SetSpritePosition (Dessin_sprite_render_image, 0,0)
SetRenderToImage (Dessin_render_image,0)
SetClearColor(255,255,255)
ClearScreen()
SetRenderToScreen()
Image = LoadImage ("jeu_dessiner.png")
Dessin_sprite_fond_ecran = CreateSprite (Image)
SetSpritePosition (Dessin_sprite_fond_ecran, 0,0)
Dessin_son_enregistrement = LoadSound ("enregistrer.wav")
EndFunction
Function Dessin_tester_zone (x as Integer, y as Integer)
Local i as Integer
Local Id as Integer
Id = -1
For i=0 to Dessin_tableau_zones.Length
If x > Dessin_tableau_zones[i].x and x < Dessin_tableau_zones[i].x + Dessin_tableau_zones[i].Largeur
If y > Dessin_tableau_zones[i].y and y < Dessin_tableau_zones[i].y + Dessin_tableau_zones[i].Hauteur
Id = Dessin_tableau_zones[i].Id
ExitFunction Id
EndIf
EndIf
Next
EndFunction Id
Function Dessin_enregistrer()
Local Fichier as String
Local Chemin as String
Chemin = "raw:" + GetDocumentsPath()
Chemin = Chemin + "/dessins_borne/"
Fichier = "dessin_" + GetCurrentDate() + "_" + str(random()) + ".png"
SaveImage (Dessin_render_image, Chemin + Fichier)
Playsound (Dessin_son_enregistrement)
EndFunction
Function Dessin_jouer()
Local x as Integer
Local y as Integer
Local Id as Integer
x = GetPointerX()
y = GetPointerY()
If x > 1400
If GetPointerPressed()
Id = Dessin_tester_zone(x,y)
If Id <> -1
Select Id
Case 1
Dessin_taille_pinceau = 4
EndCase
Case 2
Dessin_taille_pinceau = 8
EndCase
Case 3
Dessin_taille_pinceau = 12
EndCase
Case 4
Dessin_taille_pinceau = 16
EndCase
Case 5
Dessin_taille_pinceau = 24
EndCase
Case 6
Dessin_taille_pinceau = 34
EndCase
Case 7
Dessin_couleur = MakeColor (255,0,0)
EndCase
Case 8
Dessin_couleur = MakeColor (0,0,255)
EndCase
Case 9
Dessin_couleur = MakeColor (255,0,255)
EndCase
Case 10
Dessin_couleur = MakeColor (0,0,0)
EndCase
Case 11
Dessin_couleur = MakeColor (0,255,0)
EndCase
Case 12
Dessin_couleur = MakeColor (255,255,0)
EndCase
Case 13
Dessin_couleur = MakeColor (0,255,255)
EndCase
Case 14
Dessin_couleur = MakeColor (255,255,255)
EndCase
Case 15
Dessin_effacer_ecran()
EndCase
Case 16
Dessin_enregistrer()
EndCase
Case 17
Dessin_etat_jeu = JEU_QUITTER
EndCase
EndSelect
EndIf
EndIf
Else
If GetPointerState() = 1
SetRenderToImage(Dessin_render_image,0)
DrawEllipse (x,y, Dessin_taille_pinceau, Dessin_taille_pinceau, Dessin_couleur, Dessin_couleur, TRUE)
SetRenderToScreen()
EndIf
EndIf
EndFunction
Function Dessin_effacer_ecran()
SetRenderToImage (Dessin_render_image,0)
SetClearColor(255,255,255)
ClearScreen()
SetRenderToScreen()
EndFunction
Function Dessin_liberer_jeu()
DeleteSprite (Dessin_sprite_fond_ecran)
DeleteImage (Dessin_render_image)
DeleteSprite (Dessin_sprite_render_image)
DeleteSound (Dessin_son_enregistrement)
EndFunction
//-------------------------------------------------------------------------------------------------------------------------
//
// PROGRAMME
//
//-------------------------------------------------------------------------------------------------------------------------
Function Jouer_jeu_deux()
Charger_jeu_dessin()
Dessin_etat_jeu = JEU_DEBUT_NIVEAU
Repeat
Dessin_jouer()
Sync()
Until Dessin_etat_jeu = JEU_QUITTER
Dessin_liberer_jeu()
endfunction
//-------------------------------------------------------------------------------------------------------------------------
//
// FIN DE PROGRAMME
//
//-------------------------------------------------------------------------------------------------------------------------