本文整理汇总了C#中IImage.GetGraphics方法的典型用法代码示例。如果您正苦于以下问题:C# IImage.GetGraphics方法的具体用法?C# IImage.GetGraphics怎么用?C# IImage.GetGraphics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImage
的用法示例。
在下文中一共展示了IImage.GetGraphics方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
public MainWindow()
{
InitializeComponent();
MapLayer.SetAbstractGraphicsFactory(NETGraphicsFactory.getInstance());
_mapImage = MapLayer.GetAbstractGraphicsFactory().CreateImage(768, 768);
_mapGraphics = _mapImage.GetGraphics();
InitVectorMap();
//_mapTileDownloadManager = new MapTileDownloadManager(this);
_mapTileDownloadManager.Start();
_rasterMap = new RasterMap(768, 768, _mapType, _mapTileDownloadManager);
_rasterMap.SetMapDrawingListener(this);
_rasterMap.SetGeocodingListener(this);
_rasterMap.SetRoutingListener(this);
// Get the configuration file.
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
// Get the AppSetins section.
AppSettingsSection appSettingSection =
(AppSettingsSection)config.GetSection("appSettings");
MapType.MAP_TYPE_URLS.Clear();
foreach (var obj in appSettingSection.Settings.AllKeys)
{
var value = appSettingSection.Settings[obj];
object type=MapType.MAP_TYPE_NAMES[obj];
if(type!=null)
{
string url = value.Value.Replace('#', '&');
MapType.MAP_TYPE_URLS.Add(type, url);
cboMapType.Items.Add(obj);
}
}
cboMapType.Text = "MICROSOFTMAP";
}
示例2: DigitalMap
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 18JUN2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* Constructs a new DigitalMap with given Width and Height.
* @param Width the Width of the map image.
* @param Height the Height of the map image.
*/
protected DigitalMap(int width, int height)
: base(width, height)
{
_mapImage = AbstractGraphicsFactory.CreateImage(width, height);
_mapGraphics = _mapImage.GetGraphics();
}
示例3: VectorMapCanvas
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 21JUN2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* Construtor.
*/
public VectorMapCanvas()
{
GetGraphics2DInstance();
_textImage = MapLayer.GetAbstractGraphicsFactory()
.CreateImage(MapLayer.MAP_TILE_WIDTH,
IMAGE_PATERN_WIDTH);
_textGraphics = _textImage.GetGraphics();
_textGraphics.SetColor(0xC0C0FF);
_textGraphics.FillRect(0, 0, _textImage.GetWidth(), _textImage.GetHeight());
_fontTranspency = _textImage.GetRGB()[0];
_imagePattern = MapLayer.GetAbstractGraphicsFactory()
.CreateImage(IMAGE_PATERN_WIDTH,
IMAGE_PATERN_WIDTH);
_imagePatternGraphics = _imagePattern.GetGraphics();
_mapSize.X = 0; _mapSize.Y = 0;
_mapSize.MaxX = MapLayer.MAP_TILE_WIDTH;
_mapSize.MaxY = MapLayer.MAP_TILE_WIDTH;
_mapSize.Width = MapLayer.MAP_TILE_WIDTH;
_mapSize.Height = MapLayer.MAP_TILE_WIDTH;
}
示例4: MapDirectionLayer
////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS --------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ------------------
// 18JUN2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////
/**
* Constructor.
* @param Width
* @param Height
*/
public MapDirectionLayer(int width, int height)
: base(width, height)
{
_routeDrawWaypointOnly = MapConfiguration.DrawRouteWaypointOnly;
_mapDrawingTileWidth = MAP_TILE_WIDTH / MapConfiguration.MapDirectionRenderBlocks;
_routeImage = AbstractGraphicsFactory.CreateImage(MAP_TILE_WIDTH,
MAP_TILE_WIDTH);
_routeGraphics = _routeImage.GetGraphics();
if (!_routeDrawWaypointOnly)
{
_routeGraphics2D = new Graphics2D(_mapDrawingTileWidth,
_mapDrawingTileWidth);
}
//int[] rgb = routeImage.GetRGB();
//transparency = rgb[0];
}
示例5: MapDirectionRenderer
////////////////////////////////////////////////////////////////////////////
//--------------------------------- REVISIONS ------------------------------
// Date Name Tracking # Description
// --------- ------------------- ------------- ----------------------
// 18JUN2009 James Shen Initial Creation
////////////////////////////////////////////////////////////////////////////
/**
* Constrcutor.
*/
public MapDirectionRenderer()
{
if (MapConfiguration.RoutePen != null)
{
RoutePen = MapConfiguration.RoutePen;
}
else
{
RoutePen = new Pen(new Color(0x7F00FF00, false), 4);
}
if (MapConfiguration.StartIcon != null)
{
StartIcon = MapConfiguration.StartIcon;
}
else
{
StartIcon = ROUTE_ICONS[0];
}
if (MapConfiguration.EndIcon != null)
{
EndIcon = MapConfiguration.EndIcon;
}
else
{
EndIcon = ROUTE_ICONS[0];
}
if (MapConfiguration.MiddleIcon != null)
{
MiddleIcon = MapConfiguration.MiddleIcon;
}
else
{
MiddleIcon = ROUTE_ICONS[1];
}
_mapDirectionLayer = new MapDirectionLayer(MapLayer.MAP_TILE_WIDTH,
MapLayer.MAP_TILE_WIDTH);
_mapTileImage = MapLayer.GetAbstractGraphicsFactory()
.CreateImage(MapLayer.MAP_TILE_WIDTH,
MapLayer.MAP_TILE_WIDTH);
_mapTileGraphics = _mapTileImage.GetGraphics();
}