junkew Posted February 19 Share Posted February 19 At school🤣https://www.w3schools.com/html/html5_svg.asp it really depends on your scenario usecase what and how you want to create it in a gui. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Andreik Posted February 19 Share Posted February 19 6 hours ago, AttilaP said: Thanks everyone for the feedback. Using texture might not be a proper solution, as it does not have a specific pattern, it is always different. @AttilaP In my example each circle diameter it's randomly generated (but it could be generated by your own implementation) just the background grid it's a texture. AttilaP 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
junkew Posted February 21 Share Posted February 21 SVG Example written to html, Creating it is fast. Loading it in the browser seems to be acceptable even for bigger grids. I have no solution for a simple way to convert the SVG to PNG or other formats. Some examples are around  expandcollapse popup#include <FileConstants.au3> Global Const $CELL_SIZE = 30 Global Const $GRID_PADDING = 5 Global Const $MIN_CIRCLE_RADIUS = 5 Global Const $MAX_CIRCLE_RADIUS = 10 Global $START = TimerInit() Global $htmlFile func WriteHTMLHead() filewrite($htmlFile , "<!DOCTYPE html><html><body>") EndFunc func WriteHTMLFooter() filewrite($htmlFile , " </body></html>") endfunc func WriteSVGStart($grid_size) filewrite($htmlFile , "<svg width=""" & $grid_size*($CELL_SIZE+$GRID_PADDING) & """ height=""" & $grid_size*($CELL_SIZE+$GRID_PADDING)& """>") EndFunc func WriteSVGEnd() filewrite($htmlFile , " </svg>") EndFunc Func WriteSVGCircles($GRID_SIZE) Local $circleString For $i = 0 To $GRID_SIZE - 1 For $j = 0 To $GRID_SIZE - 1 Local $iRadius = Random($MIN_CIRCLE_RADIUS, $MAX_CIRCLE_RADIUS, 1) Local $iCenterX = $GRID_PADDING * 1.5 + $j * ($CELL_SIZE + $GRID_PADDING) + $CELL_SIZE / 2 Local $iCenterY = $GRID_PADDING * 1.5 + $i * ($CELL_SIZE + $GRID_PADDING) + $CELL_SIZE / 2 $circleString="<circle cx=""" & $iCenterX & """ cy=""" & $iCenterY & """ r=""" & $iRadius & """ stroke=""green"" stroke-width=""4"" fill=""yellow"" />" filewrite($htmlFile, $circlestring & @crlf) Next Next EndFunc ;==>DrawSVGCircles func writeGrid($grid_size) local $iCol local $iRow for $iRow=0 to $grid_size local $iRowY=($iRow*($CELL_SIZE+$GRID_PADDING)) filewrite($htmlFile , " <line x1=""0"" y1=""" & $iRowY & """ x2=""" & $grid_size*($CELL_SIZE+$GRID_PADDING) & """ y2=""" & $iRowY & """ style=""stroke:red;stroke-width:2"" />") next for $iCow=0 to $grid_size local $iCol=($iCow*($CELL_SIZE+$GRID_PADDING)) filewrite($htmlFile , " <line x1=""" &$iCol & """ y1=""0"" x2=""" & $iCol & """ y2=""" & $grid_size*($CELL_SIZE+$GRID_PADDING) & """ style=""stroke:red;stroke-width:2"" />") next EndFunc func exampleSVG($grid_size) $htmlFile = FileOpen("C:\demo\svgdemo.html", $FO_OVERWRITE ) WriteHTMLHead() WriteSVGStart($grid_size) writeGrid($grid_size) WriteSVGCircles ($grid_size) WriteSVGEnd() WriteHTMLFooter() fileclose($htmlFile) EndFunc exampleSVG(500)  FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now