So the problem is that if you change the size of the octagon, then the length of the lines and the radius of the circles should change as well? You can calculate the percentage between the size of these objects. For example, if the octagon is size 35 and you add 5 pixels to the line coordinates, then you can get the line length by dividing the octagon size with 7. So you can scale the lines by using, for example:
int LineLength = Size / 7;
dbLine(x2,y1,x2-LineLength,y1-LineLength);
(This is not quite accurate of course, because line length is not equal to adding pixels in both directions, but it's OK for a simple graphic.)
Something similar can be done to calculate the circle radius. However, keep in mind that your lines and circles are already pretty small. The circle radius in your example is 2 pixels, you can go down to 1 pixel but it won't get any smaller than that. So I don't know if it's worth at all to introduce such calculation. It's simpler to just change the numbers in your drawing commands until the snowflake looks good enough.