Schéma technique avec GDIP ?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Schéma technique avec GDIP ?

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 26 Oct 2017, 15:33

Merci Joedf,
Effectivement avec la documentation sur GitHub que j'avais zappé c'est beaucoup mieux. (je ne connaissais pas le concepts MarkDown, on en apprends tous les jours ;) )

SpeedMaster, toujours aussi efficace dans tes réponses :D le vrai lucky Luke du forum qui fait mouche :clap:

Merci à toi pour la position X Y et de ton aide ;)

Effectivement c'est tout le dessin qui tourne et pas juste un élément ^^

Re: Schéma technique avec GDIP ?

Post by SpeedMaster » 26 Oct 2017, 14:56

ScottMeyer wrote: J'ai pas trouvé comment on peut créer le " Canvas Surface " à partir de la position X, Y du Gui . On n'a actuellement que la hauteur et largeur. Une idée ? :wtf:
Il est possible de contenir l'entièreté du "canvas" dans un " gui control " il faut pour cela spécifier un " hwnd name " pour le contrôle et utiliser la fonction Viewport() avec le "nom hwnd" du contrôle. 8-)
joedf wrote:Il ya une fonction Canvas.Surface.Rotate(Angle)
Oui, il est aussi possible de faire tourner le canvas cela marche pour les dessins mais j'ai pas encore trouvé le moyen de faire tourner le texte.
La rotation s'effectue par rapport au coin supérieur gauche du canvas et non par rapport à son centre, il faut alors compenser en décalant le canvas avec la fonction translate() pour qu'il reste visible.

Voici un nouvel exemple (canvas dans un " text control " et rotation du contenu) ;)

Code: Select all

;https://github.com/Uberi/Canvas-AHK

#include canvas.ahk

gui, -dpiscale 

gui, font, s18 bold

gui, add, text, x10 y10, Mon Titre

gui, font, s12 normal

gui, add, button, x50 y50 grotate, Rotate

gui, add, text, , Le canvas est maintenant contenu dans un " text control " de 400 x 400 `nCliquez sur le canvas pour faire tourner son contenu

gui, add, text, w400 h400 x100 y150 grotate hwndMon_cadre border,       ;create a container control for ex. a text control and specify the hwnd name for ex. hwndMy_container_box

s := new Canvas.Surface(400,400)         ;create a new drawing area

s.Clear(0xFFA0A0A0)                      ;change la couleur du fond en gris

s.Smooth := "Best"                      ;antialiasing (améliore la qualité de l'image) .Smooth := "None" "Good" or "Best"

Gui, +LastFound
v := new Canvas.Viewport(Mon_cadre).Attach(s)                   ; use viewport function with hwnd name of a control to enclose the canvas in it for ex. v := new Canvas.Viewport(My_container_box).Attach(s)

crayon_rouge := new Canvas.Pen(0xFFFF0000,1)
crayon_vert := new Canvas.Pen(0xFF00FF00,1)
crayon_jaune := new Canvas.Pen(0x80FFFF00,5)
b := new Canvas.Brush(0xAAFF00FF)



f := new Canvas.Font("arial",18)
s.Text(new Canvas.Brush(0xaaFFFFFF),f,"test `nde dessin",300,200)       ;Text(Brush,Font,Value,X,Y,W = "",H = "")



gui, +resize
Gui, Show, x10 y10 w800 h600, Canvas Demo

gosub, space
Return

GuiClose:
ExitApp

space:

s.DrawRectangle(crayon_jaune,30,80,300,50)                   ;DrawRectangle(pen,posx,posy,Width,Height)
s.FillRectangle(b,50,50,50,50)                               ;FillRectangle(brush,posx,posy,Width,Height) 
s.DrawEllipse(crayon_jaune,150,150,50,100)                   ;DrawEllipse(pen,posx,posy,Width,Height)
s.Line(crayon_vert,15,20,300,300)                            ;draw a line .Line(Pen,x1,y1,x2,y2)

PointArray:=[[30,200],[30,300],[100,300]]                    ;set an array of points for the polygon [[X1,Y1],[X2,Y2],[X3,Y3]]
s.DrawPolygon(crayon_rouge,PointArray)                       ;draw a polygon (triangle)

v.Refresh()
Return

rotate:
s.Clear(0xFFA0A0A0)

s.Translate(40,-30)                                          ;decaler le contenu du canvas de 40 px vers la droite et 30 px vers le haut
s.rotate(10)                                                 ;effectuer une rotation de 10° ver la droite

s.DrawRectangle(crayon_jaune,30,80,300,50)                   ;DrawRectangle(pen,posx,posy,Width,Height)
s.FillRectangle(b,50,50,50,50)                               ;FillRectangle(brush,posx,posy,Width,Height) 
s.DrawEllipse(crayon_jaune,150,150,50,100)                   ;DrawEllipse(pen,posx,posy,Width,Height)
s.Line(crayon_vert,15,20,300,300)                            ;draw a line .Line(Pen,x1,y1,x2,y2)

PointArray:=[[30,200],[30,300],[100,300]]                    ;set an array of points for the polygon [[X1,Y1],[X2,Y2],[X3,Y3]]
s.DrawPolygon(crayon_rouge,PointArray)                       ;draw a polygon (triangle)



v.Refresh()
return
Cette librairie n's pas encore fini de nous révéler tous ses secrets. Si vous avez d'autres exemples merci de nous le faire savoir. :clap:

Re: Schéma technique avec GDIP ?

Post by joedf » 26 Oct 2017, 09:45

Il ya une fonction Canvas.Surface.Rotate(Angle)
https://github.com/Uberi/Canvas-AHK/blo ... otateangle

Je suis pas certain comment on l'emploie...

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 26 Oct 2017, 07:22

Salut SpeedMaster,

Superbe :bravo: Merci pour l'exemple

1) J'ai pas trouvé comment on peut creer le " Canvas Surface " à partir de la position X, Y du Gui . On n'a actuellement que la hauteur et largeur.
Quand je rajoute un " MenuBar" ça décale le Canvas donc c'est OK mais si je veux rajouter un titre par exemple avant le canvas et non pas par au dessus mais au dessus. Une idée ? :wtf:

2) Peut-on avec Canvas écrire verticalement ?

Sinon j'ai descendu la ligne :

Code: Select all

s.Text(new Canvas.Brush(0xaaFFFFFF),f,"test `nde dessin",190,200)       ;Text(Brush,Font,Value,X,Y,W = "",H = "")
Après

Code: Select all

Space:
Pour que l'écriture soit au dessus du graphique.

On ressent la mécanique de GDIP mais je trouve que c'est plus clair pour moi :crazy:

Je posterai ici mon code quand j'aurais fini. Ce gui est l'une des pièces principale de mon programme.

Re: Schéma technique avec GDIP ?

Post by SpeedMaster » 26 Oct 2017, 06:00

ScottMeyer wrote: on peut certainement augmenter la résolution
Bonjour,
Tu peux activer l'antialiasing s.Smooth := "Best" pour améliorer le rendu.
J'ai aussi ajouter dans mon example comment dessiner un polygone et changer la couleur du fond.

Re: Schéma technique avec GDIP ?

Post by joedf » 26 Oct 2017, 00:13

Totally forgot about that. Thanks for sharing SpeedMaster! :+1:

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 25 Oct 2017, 07:17

Excellent ! Merci de l'info Speed Master :D

Gros avantage le dessin est un élément du Gui et positionnable dans ce dernier.
Il est moins beau que GDIP mais j'ai pas regardé pour l'instant on peut certainement augmenter la résolution (cleartype, dpi,...) en tout cas cela m'intéresse beaucoup.

Merci

Re: Schéma technique avec GDIP ?

Post by SpeedMaster » 25 Oct 2017, 06:00

Bonjour,
Tu peux essayer ça. ;)
canvas.ahk by Uberi
https://github.com/Uberi/Canvas-AHK


Voici un example:

Code: Select all

;https://github.com/Uberi/Canvas-AHK

#include canvas.ahk

s := new Canvas.Surface(400,400)      ;create a new drawing area

s.Clear(0xFFA0A0A0)                   ;change la couleur du fond en gris

s.Smooth := "Best"                    ;antialiasing (améliore la qualité de l'image) .Smooth := "None" "Good" or "Best"

Gui, +LastFound
v := new Canvas.Viewport(WinExist()).Attach(s)

crayon_rouge := new Canvas.Pen(0xFFFF0000,1)
crayon_vert := new Canvas.Pen(0xFF00FF00,1)
crayon_jaune := new Canvas.Pen(0x80FFFF00,2)
b := new Canvas.Brush(0xAAFF00FF)



f := new Canvas.Font("arial",18)
s.Text(new Canvas.Brush(0xaaFFFFFF),f,"test `nde dessin",300,200)       ;Text(Brush,Font,Value,X,Y,W = "",H = "")


gui, +resize
Gui, Show, x10 y10 w400 h400, Canvas Demo

gosub, space
Return

GuiClose:
ExitApp

space:
s.DrawRectangle(crayon_jaune,30,80,300,50)                   ;DrawRectangle(pen,posx,posy,Width,Height)
s.FillRectangle(b,50,50,50,50)                               ;FillRectangle(brush,posx,posy,Width,Height) 
s.DrawEllipse(crayon_jaune,150,150,50,100)                   ;DrawEllipse(pen,posx,posy,Width,Height)
s.Line(crayon_vert,15,20,300,300)                            ;draw a line .Line(Pen,x1,y1,x2,y2)

PointArray:=[[30,200],[30,300],[100,300]]                    ;set an array of points for the polygon [[X1,Y1],[X2,Y2],[X3,Y3]]
s.DrawPolygon(crayon_rouge,PointArray)                       ;draw a polygon (triangle)

v.Refresh()
Return



Re: Schéma technique avec GDIP ?

Post by joedf » 22 Oct 2017, 21:26

Pas de problèmes :)

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 22 Oct 2017, 17:17

Salut,

J'avoue c'est compliqué GDIP, certainement que j'y arriverai avec du temps et beaucoup de tests (je n'abandonne pas cet idée)
Cependant dans l'immédiat j'opte plutôt pour une solution que je maîtrise mieux, plus simple pour que mon projet aboutisse après on verra pour le rendre beau.

Voilà ce que j'ai fait dis moi ce que tu en penses :D

Image

Code: Select all

#Include %A_ScriptDir%\Class_CtlColors.ahk

EXT  = 13
INT := EXT - 4 

Gui, 1:Color, EEAA99
Gui, 1:+AlwaysOnTop +Resize ; +LastFound
; Gui, Margin, 10, 10

; DEBUT
Gui, 1:Add, Text		, x0 		y0		w70 	center	hwndCouleur						,NOM
							CtlColors.Change(Couleur, "FFFF00", "000000")	
Gui, 1:Add, Text		, x70 		y0		w60 			Right	-Background				,Position
Gui, 1:Add, Text		, x135 		y0		w%EXT% 	h%EXT%  hwndCouleur   					; CARRE EXTERIEUR
							CtlColors.Change(Couleur, "0000FF", "000000")	
Gui, 1:Add, Text		, xp+2  	yp+2  	w%INT%  h%INT%  hwndCouleur  					; CARRE INTERIEUR
							CtlColors.Change(Couleur, "FFFFFF", "000000")	
; LIGNES
Gui, 1:Add, Text		, xp+11		yp+3 	w100	h4		hwndCouleur		vW_Largeur_Max	; LIGNE 1						,
							CtlColors.Change(Couleur, "000000", "000000")	
	
; FIN
Gui, 1:Add, Text		, X0 		y0		w%EXT% 	h%EXT%  hwndCouleur 	vX_Last_EXT		; CARRE EXTERIEUR
							CtlColors.Change(Couleur, "FF0000", "000000")	
Gui, 1:Add, Text		, xp+2  	yp+2  	w%INT%  h%INT%  hwndCouleur		vX_Last_INT		; CARRE INTERIEUR
							CtlColors.Change(Couleur, "FFFFFF", "000000")
Gui, 1:Add, Text		,  			y0		w60 	Left	-Background		vX_Last2		,Position
Gui, 1:Add, Text		,  			y0		w70 	center	hwndCouleur		vX_Last1		,NOM
							CtlColors.Change(Couleur, "FFFF00", "000000")	

; TESTS ECRITURE VERTICALE
Gui, 1:Add, Text		, X170 		y20		w10	 	center	hwndCouleur						,0`n1`n6`nà`n0`n1`n7
							CtlColors.Change(Couleur, "A9F5A9", "000000")	

Gui, 1:Show				, xCenter y90 	w400 h140											, GUI REDIMENSIONNABLE 
Return

guisize:
GuiControl			, 1:move	, X_Last1			, % "x"A_GuiWidth - 70 
GuiControl			, 1:move	, X_Last2			, % "x"A_GuiWidth - 70 - 60
GuiControl			, 1:move	, X_Last_EXT		, % "x"A_GuiWidth - 70 - 60 - 13 - 5
GuiControl			, 1:move	, X_Last_INT		, % "x"A_GuiWidth - 70 - 60 - 13 - 3
GuiControl			, 1:move	, W_Largeur_Max		, % "w"(A_GuiWidth - 146 - 149) 
WinSet				, Redraw	,
Return

F11::
; CtlColors.Attach(Couleur, "000000", "FFFFFF")
CtlColors.Change(Couleur, "0000FF", "FFFFFF")
; CtlColors.Detach(Couleur)
Return

F12::Reload

Close:
CtlColors.Detach(Couleur)
ExitApp
Fichier AHK + Function CtrlColor => http://atelierludique.free.fr/000/UPLOA ... HNIQUE.zip

Re: Schéma technique avec GDIP ?

Post by joedf » 22 Oct 2017, 15:00

mais oui, deuxieme exemple?

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 22 Oct 2017, 09:49

Bonjour joedf,

Oh ! Merci pour les exemples, ça aide beaucoup.

Il n'est pas possible de faire apparaître la fenêtre autour ? quand je mets " +Caption " tout disparait ...
Sinon il faudrait faire apparaît cette objet flottant au dessus d'un Gui classique et s'assurer qu'il suit la fenêtre classique hum ...

Sans parler de GDIP ou autre, est-il possible de faire du texte à la verticale ?

Re: Schéma technique avec GDIP ?

Post by joedf » 21 Oct 2017, 21:05

Jai un autre example que jai modifier un peu qui demontre la rotation par une methode plus simpliste.

Code: Select all

;modified from https://autohotkey.com/board/topic/99796-gdip-draw-rotated-text-onto-an-image/#entry625679
;test by joedf
#Include gdip.ahk

If !pToken := Gdip_Startup()
{
   MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
   ExitApp
}
OnExit, Exit
Width := A_ScreenWidth, Height := A_ScreenHeight
Gui, 1: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 1: Show, NA
hwnd1 := WinExist()
hbm := CreateDIBSection(Width, Height)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetSmoothingMode(G, 4)

pPen_plot_lines := Gdip_CreatePen(0xff000000, 2)
pPen_area := Gdip_CreatePen(0xffcccccc, 2)

pPen_BlueLine := Gdip_CreatePen(0xff0000ff, 2)

pBrush_area_fill := Gdip_BrushCreateSolid(0xffffffff)
Gdip_FillRectangle(G, pBrush_area_fill, 50, 50, 550, 550)
Gdip_DrawRectangle(G, pPen_area, 49, 49, 551, 551)


Gdip_DrawLine(G, pPen_BlueLine, 200, 500, 500, 200)

Gdip_DrawLine(G, pPen_plot_lines, 200, 500, 500, 500)
Gdip_DrawLine(G, pPen_plot_lines, 200, 500, 200, 200)

Options = x270 y520 cff000000 s18 r4
Gdip_TextToGraphics(G, "This is the x label", Options)
Options = x270 y550 cff000000 s18 r4




rc:=Gdip_TextToGraphics(G, "This is the y label", Options,,,,1)
;x = RC1, y = RC2, width = RC3, height = RC4, number of characters = RC5, number of lines = RC6
StringSplit, rc,rc,|

pBitmap2:=Gdip_CreateBitmap(rc3,rc4)
pGraphics :=Gdip_GraphicsFromImage(pBitmap2)
Gdip_GraphicsClear(pGraphics, 0xffffffff)      ;easier than using brush to fill 

Options = x0 y0 cff000000 s18 r4
rc:=Gdip_TextToGraphics(pGraphics, "This is the y label", Options)
Gdip_ImageRotateFlip(pBitmap2, 3)
Gdip_DrawImage(G, pBitmap2, 170,240, rc4, rc3)

UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height) ;show all of that stuff we just did
return
Exit:
Gdip_DeletePen(pPen_area)
Gdip_DeletePen(pPen_plot_lines)
Gdip_DeleteBrush(pBrush_area_fill)
SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc)
Gdip_DisposeImage(pBitmap)
Gdip_DisposeImage(pBitmap2)
Gdip_DeleteGraphics(pGraphics)
Gdip_DeleteGraphics(G)
Gdip_Shutdown(pToken)
ExitApp
Return
Esc::ExitApp

Re: Schéma technique avec GDIP ?

Post by joedf » 21 Oct 2017, 20:53

Cette example devrais demontrer la base que tu aura besoin.
Mais cela utilise Gdip v1.45: https://raw.githubusercontent.com/acorn ... r/Gdip.ahk
Gdip v2 n'a pas encore les fonctions de rotation, et particle class fonctionne avec v1.45 seulement.
Je n'ai pas beaucoup d'experience avec gdip. Je sais comment ca fonctionne en principle, mais j'en ai pas encore eu besoin.

Code: Select all

;modified example by joedf
#SingleInstance, Force
#NoEnv
SetBatchLines, -1

; Uncomment if Gdip.ahk is not in your standard library
#Include, Gdip.ahk

; Start gdi+
If !pToken := Gdip_Startup()
{
	MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
	ExitApp
}
OnExit, Exit

; Set the width and height we want as our drawing area, to draw everything in. This will be the dimensions of our bitmap
Width :=300, Height := 200

; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Show, NA ; Show the window
hwnd1 := WinExist() ; Get a handle to this window we have created in order to update it later


pBitmap := Gdip_CreateBitmap(Width, Height)
G := Gdip_GraphicsFromImage(pBitmap)
Gdip_SetSmoothingMode(G, 4) ;anti-alias


OriginalWidth := Width
OriginalHeight := Height



;draw stuff
pBrushGrey := Gdip_BrushCreateSolid(0xffdfdfdf)
pBrushRed := Gdip_BrushCreateSolid(0xffff0000)
pPenBlue := Gdip_CreatePen(0xff0000ff, 10)
pPenGreen := Gdip_CreatePen(0xff00ff00, 10)
Gdip_FillRectangle(G, pBrushGrey, 0, 0, OriginalWidth, OriginalHeight)
Gdip_FillEllipse(G, pBrushRed, 50, 50, OriginalWidth-100, OriginalHeight-100)
Gdip_DrawRectangle(G, pPenBlue, 0, 0, OriginalWidth, OriginalHeight)
Gdip_DrawLine(G, pPenGreen, 0, 0, OriginalWidth, OriginalHeight)
Gdip_TextToGraphics(G, "This is the y label", "x20 y20 cff000000 s18 r4")



Angle := 270


Gdip_GetRotatedDimensions(Width, Height, Angle, RWidth, RHeight)
Gdip_GetRotatedTranslation(Width, Height, Angle, xTranslation, yTranslation)

;MsgBox [%RWidth%,%RHeight%,%xTranslation%,%yTranslation%]

hbm := CreateDIBSection(RWidth, RHeight)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc), Gdip_SetInterpolationMode(G, 7)

Gdip_TranslateWorldTransform(G, xTranslation, yTranslation)
Gdip_RotateWorldTransform(G, Angle)

Gdip_DrawImage(G, pBitmap, 0, 0, Width, Height, 0, 0, OriginalWidth, OriginalHeight)
Gdip_ResetWorldTransform(G)

*/

; Delete the brush/pen as it is no longer needed and wastes memory
Gdip_DeleteBrush(pBrushGrey)
Gdip_DeletePen(pPenBlue)


UpdateLayeredWindow(hwnd1, hdc, (A_ScreenWidth-RWidth)//2, (A_ScreenHeight-RHeight)//2, RWidth, RHeight)

OnMessage(0x201, "WM_LBUTTONDOWN")


SelectObject(hdc, obm) ; Select the object back into the hdc
DeleteObject(hbm) ; Now the bitmap may be deleted
DeleteDC(hdc) ; Also the device context related to the bitmap may be deleted
Gdip_DeleteGraphics(G) ; The graphics may now be deleted
Return


;#######################################################################

; This function is called every time the user clicks on the gui
; The PostMessage will act on the last found window (this being the gui that launched the subroutine, hence the last parameter not being needed)
WM_LBUTTONDOWN()
{
	PostMessage, 0xA1, 2
}

;#######################################################################

;#######################################################################

Exit:
; gdi+ may now be shutdown on exiting the program
Gdip_Shutdown(pToken)
ExitApp
Return

Esc::
goto Exit

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 21 Oct 2017, 17:55

Question supplémentaire,

Peut-on écrire du texte verticalement simplement ?

Exemple :
Image

Merci

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 21 Oct 2017, 10:59

Salut,

Pourrais-tu s'il te plait me faire un petit script avec GDIP2
avec un trait + un rond + un rectangle + du texte ? avec des couleurs différents :oops:
Ca m'aiderai beaucoup je m'en servirais comme exemple et ça évitera que je fasse un code pas propre :D

Re: Schéma technique avec GDIP ?

Post by joedf » 21 Oct 2017, 10:47

En fait, jpense que ça serait mieux de juste utiliser gdip sans particles class/system.
C'est plutôt pour des trucs animés/d'animations.

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 21 Oct 2017, 03:53

En faite on peut faire juste apparaître un graphique sans mouvement (et sans flash) . J'ai fait tellement de test que je suis un peu perdu. Je croyais que Particules_Class n'utilisait pas GDI mais en faite si :problem:

Donc es ce que ça peut m'arranger ou complexifier la chose ???

Test Particules Class + GDI sans mouvement :

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
; #singleInstance, off
#singleInstance, force
setBatchLines, -1
#include %A_ScriptDir%\Gdip.ahk
#include %A_ScriptDir%\particles_class.ahk

gui, add, picture, w400 h400 0xE hwndPHWND				; this control is what we draw onto. give it an HWND (i named it "PHWND") so we can draw onto it.
gui show, w300 h300 autosize
Gui +LastFound + Resize


pToken:=Gdip_Startup()									; Start gdi+, this is required.

; create a system that runs at 30 fps
psys:=new particles(100)

; create a display/canvas using the dimensions of the picture control "PHWND"
; set the quality to 4, which is the best but slowest (1-4) 
psys.setCanvas(0, 0, 0, 0, 4, PHWND)

; add an emitter, this is what stores all the info of how a particle should behave
; if unset, it uses the default values
e1:=psys.addEmitter()  ; create the emitter, save its pointer as "e1" for easy access 
e1.type:="text"        ; how it displays
e1.circleSize:=[22] ; at the start of its life, it'll be size 22 text, at the end, 18
e1.color:=["000000"]   ; what color(s) it'll be
e1.LineWidth:=[5, 1] ; transition from 5 to 1 pixels over its life
psys.addParticle(50, 50, 1, "O1_O2")
psys.addParticle(70, 70, 1, "ABC")
psys.draw(PHWND) ; finally, draw it onto the gui.

http://atelierludique.free.fr/000/UPLOA ... _class.zip

Re: Schéma technique avec GDIP ?

Post by joedf » 21 Oct 2017, 00:19

Cest pour creer des effets flashs, me semble que ca sera pas tres pratique pour des schemas non?

Re: Schéma technique avec GDIP ?

Post by ScottMeyer » 20 Oct 2017, 07:19

Bonjour,

Oui GDip2 , même si il n'est pas complet et si il ne plante pas
il fait des choses simple comme mes besoins le demande, ça me vas 8-)

Sinon Oui Particule class https://github.com/acorns/Particle-System
Je pense qu'il peut faire ce que je demande.
Par contre ce type de code n'es pas conventionnel par rapport au language AHK, et j'ai un peu de mal :oops:

Top