STATE_point_set_bitmap_xy

 

 


#define FIND_COORDINATE_AUTOMATICALLY  -1
  Set the bitmap coordinates of the given points.
  Examples:
  	A)	  Attach the polygon's bitmap top left corner to the given point.
  		double xy[2]={0,0}
  		STATE_point_set_bitmap_xy(pnt1,owner_polygon_handle, xy);
  
  	B)	  Attach the polygon's bitmap bottom right corner to the given point.
  		double xy[2]={1,1}
  		STATE_point_set_bitmap_xy(pnt1,owner_polygon_handle, xy);
  
  	C)	  This tells the engine to figure out on his own to witch part of the bitmap
  		  this point should be attached. This is very useful since sometimes the right bitmap coord
  		  could look like 0.5543222323 etc... For example if our polygon has a trapez shape or a pentagon shape
  		  Please note that in order for the engine to figure out on his own it must previously give it
  		  Three other coords. The actual calculation of all the missing coordinates is done when
  		  We call STATE_engine_add_polygon()
  		double xy[2]={FIND_COORDINATE_AUTOMATICALLY, FIND_COORDINATE_AUTOMATICALLY}
  		STATE_point_set_bitmap_xy(pnt1,owner_polygon_handle, xy);
  	D)	   Like "C" only that one coordinate element  we give and one we ask the engine to find.
  		   In this example we ask to find the y bitmap coordinate. In order for the engine to find it on its own
  		   We must give him befroehand three other y values.
  		double xy[2]={0, FIND_COORDINATE_AUTOMATICALLY}
  		STATE_point_set_bitmap_xy(pnt1,owner_polygon_handle, xy);
  
  	E)	How to tile a bitmap over a polygon. Lets say we have
  		a square polygon and we want to tile a bitmap .In this example it will be tiled 5x5 .
  
  		double xy[2]={0, 0}
  		STATE_point_get_bitmap_xy(pnt1, xy);   The top left
  		xy[0]=5;
  		STATE_point_set_bitmap_xy(pnt2,owner_polygon_handle, xy);   The top right
  		xy[1]=5;
  		STATE_point_set_bitmap_xy(pnt3,owner_polygon_handle, xy);   The bottom right. xy==[5,5]
  		xy[0]=FIND_COORDINATE_AUTOMATICALLY;
  		xy[1]=FIND_COORDINATE_AUTOMATICALLY;
  		STATE_point_set_bitmap_xy(pnt4,owner_polygon_handle, xy);   We have already three points so the engine
  											    can figure out the rest on its own. In this case
  											    If our polygon is a square it should calculate xy={0,5}
  											    It is better to let the engine handle the forth point and above
  											    to avoid mistakes.

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com