home products news downloads documentation support gallery online maps resellers search
TNTmips Downloads Menu

HOME

CONTACT US

CURRENT RELEASE
  TNT 2013

DEVELOPMENT VERSION
  TNT 2014

TNTmips Pro
PRIOR RELEASES
  TNT 2012

FREE SOFTWARE
  TNTmips Free
  TNTatlas
  TNTsdk

MORE DOWNLOADS
  HASP Key Driver
  Screen Recorder
  TNT Language Kits
  Sample Geodata
  TNT Scripts

DOCUMENTATION
  TNTmips Tutorials
  Tutorial Datasets
  Technical Guides
  Scripts
  Quick Guides

MORE INFO
  Download FAQs
  FTP
  Download Managers
  Find Reseller

SITE MAP


raster_labeller.sml


#raster labeller.sml
#written by: David Friberg
#date: 27 July 2004
#
#Purpose:
#		Use this SML Layer to add labels to all raster layers 
#		in a group.  Label used is the name of the raster.
#
#Requirements:
#		TNTmips 6.9
#		Must be used as an SML layer in the Display process.
#
#To use:
#		Add all raster layers to be labeled.
#		Add this SML layer.

class GRE_LAYER curLayer = ThisLayer.Group.FirstLayer;
ThisLayer.Name = "Labels";
DrawTextSetColors("red","red");

SetLineWidth(4);
DrawTextSetHeightPixels(13);
while(curLayer != 0) {
	if(curLayer.Type == "Raster") {
		class RASTER curRast;
		DispGetRasterFromLayer(curRast, curLayer);
		class GEOREF curGeoref;
		curGeoref = GetLastUsedGeorefObject(curRast);
		class POINT2D labelPos = ObjectToMap(curRast, 0, 15, curGeoref);
		class TRANSPARM trans;
		trans.InputCoordRefSys = curGeoref.CoordRefSys;
		trans.OutputProjection = ThisLayer.Projection;
		labelPos = trans.ConvertPoint2DFwd(labelPos);
		
		MoveTo(labelPos.x, labelPos.y);
		DrawTextSimple(sprintf("%s", curLayer.Name));
	}
	curLayer = curLayer.NextLayer;
}


Back Home ©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010   USA
Business & Sales: (402)477-9554  Support: (402)477-9562  Fax: (402)477-9559
Business info@microimages.com  Support support@microimages.com  Web webmaster@microimages.com

25 March 2009

page update: 26 May 11