Fit CADImport.DRect to CADPictureBox
Moderators: SDS, support, admin
Fit CADImport.DRect to CADPictureBox
Hi,
my CADImage contains several drawings and I have a list of DRect of each drawing.
I would like to show selected DRect of particular drawing in CADPictureBox.
I tried to convert the coordinates using the GetPoint, but I can't calculate the correct ImageScale or can't set center image in CADPictureBox, so drawing is somewhere in black darkness....
Can you help me to fit part of CADImage specified by DRect to window of CADPictureBox?
Thanks for any help
Bath
my CADImage contains several drawings and I have a list of DRect of each drawing.
I would like to show selected DRect of particular drawing in CADPictureBox.
I tried to convert the coordinates using the GetPoint, but I can't calculate the correct ImageScale or can't set center image in CADPictureBox, so drawing is somewhere in black darkness....
Can you help me to fit part of CADImage specified by DRect to window of CADPictureBox?
Thanks for any help
Bath
Re: Fit CADImport.DRect to CADPictureBox
Hello Bath,
Mikhail
Could you specify the values stored in DRect instances for each drawing?I have a list of DRect of each drawing
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Fit CADImport.DRect to CADPictureBox
One DRect has location and size of one drawing. All drawings are in one CADImage.
DRect represent paper size (A0 to A4) and orientation (landccape or portrait).
DRect represent paper size (A0 to A4) and orientation (landccape or portrait).
Re: Fit CADImport.DRect to CADPictureBox
DRect structure operates with CAD units, therefore, using a paper size which is measured in mm (inches) is not quite correct.DRect represent paper size (A0 to A4)
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Fit CADImport.DRect to CADPictureBox
There is large area in my CADImage (loaded from dwg file) where are several drawings with a frame (rectangle), mostly its borders are four CADLines.
CADImage units are millimeters. (CADImage.Milimeters=True)
The list of DRects is created on the fly from a CADEntityCollection of CADImage by reading coordinates of CADLines, e.g. horizontal lines width are 210 and vertical lines height are 297, lines are joined to each other , so I have DRect 210 x 297 and its location.
CADImage.Extends, CADLines and later list of DRects have same units.
It seems that they are in CAD units, actually the same as millimeters. Or not?
In CADViewer sample after CADImage is loaded, all (large area of) image (DRect = Image.Extends) is shown fitted to window in CADPictureBox. I’d like to show part of image given by DRect item of list of DRect(s) to see particular DRect maximal zoomed to CADPictureBox.DisplayRectangle.
How to convert the coordinates (Pixels? CADUnits? MMToPixels?), calculate scale and center zoomed (DRect) part of image in CADPictueBox ?
CADImage units are millimeters. (CADImage.Milimeters=True)
The list of DRects is created on the fly from a CADEntityCollection of CADImage by reading coordinates of CADLines, e.g. horizontal lines width are 210 and vertical lines height are 297, lines are joined to each other , so I have DRect 210 x 297 and its location.
CADImage.Extends, CADLines and later list of DRects have same units.
It seems that they are in CAD units, actually the same as millimeters. Or not?
In CADViewer sample after CADImage is loaded, all (large area of) image (DRect = Image.Extends) is shown fitted to window in CADPictureBox. I’d like to show part of image given by DRect item of list of DRect(s) to see particular DRect maximal zoomed to CADPictureBox.DisplayRectangle.
How to convert the coordinates (Pixels? CADUnits? MMToPixels?), calculate scale and center zoomed (DRect) part of image in CADPictueBox ?