Last post Oct 20, 2009 12:51 AM by SonicMouse
Oct 19, 2009 10:28 PM|SonicMouse|LINK
I have a question about custom units of measurement. I want to use GDI+ because I will have to draw vector objects and plain old GDI won't cut it. I am writing software for hardware which basically uses measurements that aren't typical (the measurements
are 5000/12 == 1 inch). So, is there a way to use SetPageUnit() to use my custom measurement? If not, how would I accomplish this? This code works for me, but it's GDI, not GDI+:
static const float INCH = 5000.0f/12.0f;
This would draw "Hello World" at 2",5" perfectly. I noticed that if i run this code, then attach a Graphics object to the CDC it keeps the units, but i don't know if that is the proper way to do this in GDI+, which is why i am here!
Thanks for any tips!
Oct 20, 2009 12:51 AM|SonicMouse|LINK
OK, i think i figured it out...
What i can do is use SetPageUnit(UnitDocument), then just make the size of the area 5000x5000 (drawing a rectangle 5000x5000 which is 12"x12" on the target hardware), then just use SetTransform to "zoom" out. This way i get an area that is 5000x5000 "static"
units (i.e. the area looks the same on any computer)
If i am way off, just let me know... but in the meantime i will try to work with this...