I read this documentation but I'm still confused.
using (Font font1 = new Font("Arial", 10.0f))
{
byte charset = font1.GdiCharSet;
}
In the code, does it mean that we are introducing a new instance of Font class called font1
. However, this instance will be alive ONLY within the curly brackets. Further on in the code we can again instantiate font1
but that will be a completely different instance since the previous font1
was disposed
.
Is this correct? Then what is the purpose? We could reassign different values to font1
without disposing the previous one?