Retrieving coordinates from bitmap...
Moderators: SDS, support, admin
Retrieving coordinates from bitmap...
Hi,
the topic is a little bit hard to understand. Didn't know how tro explain my question in short words..
I need to do an animation on the cad- file (DXF). If i do this with the internal 'AddLine' usw. the whole drawing will be completely refreshed and the picture is flickering.
My idea is to assign the cad- file to a bitmap where i can do double- buffering and all the necessary stuff for a smooth animation.
My problem:
I like to attach the loaded cad- file to a bitmap- object using stretchdraw.
Now i need to know the bitmap- coordinates (If i want to draw anytthing using the canvas- methods) where the cad- internal things are located.
Example: I need a line on Cad- position X,Y -> What bitmap- coordinates i have to draw to?
Can you give me short example of getting the coordinates (Have tried some documnted methods, but always got weird coordinates)?
Regards Cliff
the topic is a little bit hard to understand. Didn't know how tro explain my question in short words..

I need to do an animation on the cad- file (DXF). If i do this with the internal 'AddLine' usw. the whole drawing will be completely refreshed and the picture is flickering.
My idea is to assign the cad- file to a bitmap where i can do double- buffering and all the necessary stuff for a smooth animation.
My problem:
I like to attach the loaded cad- file to a bitmap- object using stretchdraw.
Now i need to know the bitmap- coordinates (If i want to draw anytthing using the canvas- methods) where the cad- internal things are located.
Example: I need a line on Cad- position X,Y -> What bitmap- coordinates i have to draw to?
Can you give me short example of getting the coordinates (Have tried some documnted methods, but always got weird coordinates)?
Regards Cliff
Re: Retrieving coordinates from bitmap...
Hello Cliff.
Bitmap as any other raster image is a set of pixels. DXF (vector) drawing converted to raster image will lose all entities information. Generally you can select raster width and height to provide easy calculation from CAD coordinates to raster coordinates. However this won't work with large DXF that includes many entities - size of bitmap can be too big or entities will interfere.
CAD Import VCL provides method to recalculate CAD coordinates to screen (control) coordinates. This is a bit different because currently visualized part only of CAD image recalculated.
Also TsgDrawingNavigator class that provided as graphics container for TsgCADImage includes DoubleBuffered property.
Alexander.
Bitmap as any other raster image is a set of pixels. DXF (vector) drawing converted to raster image will lose all entities information. Generally you can select raster width and height to provide easy calculation from CAD coordinates to raster coordinates. However this won't work with large DXF that includes many entities - size of bitmap can be too big or entities will interfere.
CAD Import VCL provides method to recalculate CAD coordinates to screen (control) coordinates. This is a bit different because currently visualized part only of CAD image recalculated.
Also TsgDrawingNavigator class that provided as graphics container for TsgCADImage includes DoubleBuffered property.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Retrieving coordinates from bitmap...
Thanks for the quick reply!
My Task:
We are programming a huge cutting machine where we are cutting material- stripes of 400m length.
Within thes stripes there are very simple contours.
I'd like to visualize the current position of the cutting- knifes on the material (Speed of material is round about 2m/s). So the update rate is pretty fast...
Regards Cliff
I will give it a try.Also TsgDrawingNavigator class that provided as graphics container for TsgCADImage includes DoubleBuffered property
My Task:
We are programming a huge cutting machine where we are cutting material- stripes of 400m length.
Within thes stripes there are very simple contours.
I'd like to visualize the current position of the cutting- knifes on the material (Speed of material is round about 2m/s). So the update rate is pretty fast...
Regards Cliff
Re: Retrieving coordinates from bitmap...
Hello Cliff.
The stripe drawing stored in CAD file and the width of stripe is much lesser than length, correct? As a possible solution for such task you can visualize a small section of stripe with TsgDrawingNavigator.ShowPoint method then move stripe visible area with TsgDrawingNavigator.MovePictureRect. In this case TsgCADImage.GetPoint method can be used to recalculate CAD coordinates to screen coordinates.
Alexander.
The stripe drawing stored in CAD file and the width of stripe is much lesser than length, correct? As a possible solution for such task you can visualize a small section of stripe with TsgDrawingNavigator.ShowPoint method then move stripe visible area with TsgDrawingNavigator.MovePictureRect. In this case TsgCADImage.GetPoint method can be used to recalculate CAD coordinates to screen coordinates.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support