Hi there
So far, I created a command line tool to export hpgl files to jpg. Now, I want to extend the tool to provide the export of regions of the file. The coordinates should be specified via command arguments (eg. two corner points of a region).
I tried to use SetDrawingBoxCAD to set the coordinates but the whole image will be exported to jpg and not only the desired region.
Hope somebody can help. Thanks
david
CADImage: Create JPEG of part of image
Moderators: SDS, support, admin
Dear David,
SetDrawingBoxCAD sets drawing's coordinates in absolute coordinates. The cause of the problem perhaps in incorrect coordinate's setting when calling SetDrawingBoxCAD.
It is possible to find out whether the problem is in coordinates as we've described above by demoVC available in CADImage package (http://www.cadsofttools.com/download/CADImage.zip) in CADImage\DemoVC folder.
It is possible using this demo to check if mouse coordinates coincide with those that you set.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
SetDrawingBoxCAD sets drawing's coordinates in absolute coordinates. The cause of the problem perhaps in incorrect coordinate's setting when calling SetDrawingBoxCAD.
It is possible to find out whether the problem is in coordinates as we've described above by demoVC available in CADImage package (http://www.cadsofttools.com/download/CADImage.zip) in CADImage\DemoVC folder.
It is possible using this demo to check if mouse coordinates coincide with those that you set.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Dear Sergey
Thanks for your reply.
If I'm using the demoVC application to save a drawing to the jpg format, the same occures: when I changed the scale, the coordinates of the drawing box are set correctly. But if I want to save the content of the drwaing box to a raster image, the whole drawing will be saved and not only the content of the box.
Let's say, there is a drawing with the following coordinates:
upper left corner (0,0), lower right corner (2000,2000).
Now I want to get a jpg image containing a region of the drawing only, e.g. with the two corners (500,500) and (1000,1000).
Might be my question was not precisly enough.
Thank you
david
Thanks for your reply.
If I'm using the demoVC application to save a drawing to the jpg format, the same occures: when I changed the scale, the coordinates of the drawing box are set correctly. But if I want to save the content of the drwaing box to a raster image, the whole drawing will be saved and not only the content of the box.
Let's say, there is a drawing with the following coordinates:
upper left corner (0,0), lower right corner (2000,2000).
Now I want to get a jpg image containing a region of the drawing only, e.g. with the two corners (500,500) and (1000,1000).
Might be my question was not precisly enough.
Thank you
david
Dear David,
We have renewed CADImage.zip package (http://www.cadsofttools.com/download/CADImage.zip).
Selecting in DemoVС [Options -> On/Off drawingbox] menu command calls SetDrawingBoxCAD and cuts off a half of the drawing.
MainWindow.cpp includes this function:
Please try renewed CADImage package. It must be Ok!
Sergey.
please post questions to the forum or write to support@cadsofttools.com
We have renewed CADImage.zip package (http://www.cadsofttools.com/download/CADImage.zip).
Selecting in DemoVС [Options -> On/Off drawingbox] menu command calls SetDrawingBoxCAD and cuts off a half of the drawing.
MainWindow.cpp includes this function:
Code: Select all
void CMainWindow::SetDrawingBox()
{
optionsCAD.IsDrawingBox = true;
<b>if</b> ((CADImage != NULL) && !bIsRotated)
{
rectDrawingBox.Points.Left = (frectExtentsCAD.Points.Left + frectExtentsCAD.Points.Right)/2;
rectDrawingBox.Points.Top = frectExtentsCAD.Points.Top;
rectDrawingBox.Points.Z1 = 0;
rectDrawingBox.Points.Right = frectExtentsCAD.Points.Right;
rectDrawingBox.Points.Bottom = frectExtentsCAD.Points.Bottom;
rectDrawingBox.Points.Z2 = 0;
SetDrawingBoxCAD(CADImage, &rectDrawingBox);
RecalculateExtents();
RePaint();
}
}
Sergey.
please post questions to the forum or write to support@cadsofttools.com