|
||||||
Main Page Downloads Support Contact![]() |
||||||
|
COMPANY PAGES PRODUCTS DOWNLOADS SUPPORT
|
QuestionHow to programmatically rotate raster files by 90, 180 or 270?
Answer
Problem description:
CADRaster and other programs from TSL family allow to change the presentation orientation of raster files. This change of presentation is made in logical way, without any physical interference with raster data. It is very useful feature, which lets you save time wasted on physical rotation of scanned documents to match them together and left the documents in the best possible quality, because every edition introduce some deformations.
Everything is fine as long as you do not need to use these files in other applications, which do not support logical orientations or have to give them to your cooperators using not TSL software. Here comes a need to physically change all files.
Solution:
If the number of files to change is small you can do that manually using standard CADRaster command RRotate... with on of sub-options: left by 90, left by 180, left by 270, flip horizontal or flip vertical. If you have a lot of documents it could be a more serious problem.
Starting with version 4.50 of CADRaster the problem is not really so serious because we have added a new API method Rotate90. This method, with syntax described below, let you programmatically rotate as many documents as you need without forcing you to manually repeat the same actions for thousand(s) documents.
BOOL Rotate90 (short iAngle, BSTR FAR * sErr) short iAngle - defines rotation option:
1 - rotate raster by 90 degrees 2 - rotate raster by 180 degrees 3 - rotate raster by 270 degrees 4 - mirror raster horizontally 6 - mirror raster vertically string sErr - string where Rotate90 method returns error description
How to use the sample macro:
1. Download Rotate90.exe - which expands as an AutoCAD VBA macro file and Read_me.txt with basic information about this sample
2. Start AutoCAD with CADRaster 3. Open a raster file for edition 4. Load "rot90.dvb" project using VBA\Load Project menu for AutoCAD R14 or Tools\Macro\Load Project menu for AutoCAD R14.01 5. Start Macros dialog using VBA\Run Macro menu for AutoCAD R14 or Tools\Macro\Run Macro menu for AutoCAD R14.01 6. Select CADRaster module and then start "rot90"
Requirements:
|
|||||
|
||||||