In a form I have a picturebox which contains a circular shape placed at a position resulting from some calculation, usually at or near the center, but sometimes it comes out too offset from the center that part of it is clipped as in these figures:
Now I have made a printing function where a rectangle is printed representing the border of the picturebox and I use the circle method to draw the circle inside. When the circle is clipped in the picturebox as in the right figure part of the circle comes out of the rectangle and overlaps other information printed at the sides.
What would be a way around so that the circle came out clipped by the rectangle?
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
if the circle is correct in the picturebox, why not print the picturebox, instead of drawing again to the printer?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
if the circle is correct in the picturebox, why not print the picturebox, instead of drawing again to the printer?
Since in the printer the size must be different I tried Stretchblt but it didn't look nice.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
Glad it looks like or at least suggests a possible solution. I just went for a walk in the GDI section of the MSDN Library CDs and that's what I came up with.
There may well be a better approach but someone with more graphics background will have to suggest it. I didn't find anything in the VB6 parts of the documentation for doing this with decent results.