public void CreateScalableImage( DxfEntity entity, DrawContext.Wireframe drawContext, IBitmapProvider bitmapProvider, Polyline4D clipPolygon, Size2D displaySize, Vector4D transformedOrigin, Vector4D transformedXAxis, Vector4D transformedYAxis) { if (!this.graphicsConfig_0.DrawImages || bitmapProvider == null) { return; } this.method_4(false, (Interface12) new Class463(bitmapProvider, clipPolygon, displaySize, transformedOrigin, transformedXAxis, transformedYAxis)); }
public void CreateScalableImage( DxfEntity entity, DrawContext.Wireframe drawContext, IBitmapProvider bitmapProvider, Polyline4D clipPolygon, Size2D displaySize, Vector4D transformedOrigin, Vector4D transformedXAxis, Vector4D transformedYAxis) { transformedXAxis *= displaySize.X; transformedYAxis *= displaySize.Y; this.bounds3D_0.Update(this.matrix4D_0.TransformTo3D(transformedOrigin)); this.bounds3D_0.Update(this.matrix4D_0.TransformTo3D(transformedOrigin + transformedXAxis)); this.bounds3D_0.Update(this.matrix4D_0.TransformTo3D(transformedOrigin + transformedYAxis)); this.bounds3D_0.Update(this.matrix4D_0.TransformTo3D(transformedOrigin + transformedXAxis + transformedYAxis)); }
/// <summary> /// Adds a provider /// </summary> /// <param name="provider">The provider</param> void IBitmapConsumer.Add(IBitmapProvider provider) { if (provider != null & provider != null) { throw new Exception("Provider already exists"); } this.provider = provider; if (provider == null) { pBmp = null; return; } pBmp = provider.Bitmap; if (pBmp != null) { createTransition(); } }
public Class973( DxfEntity entity, DrawContext.Wireframe drawContext, IBitmapProvider bitmapProvider, Polyline4D clipPolygon, Size2D displaySize, Vector4D transformedOrigin, Vector4D transformedXAxis, Vector4D transformedYAxis) { this.dxfEntity_0 = entity; this.wireframe_0 = drawContext; this.ibitmapProvider_0 = bitmapProvider; this.polyline4D_0 = clipPolygon; this.size2D_0 = displaySize; this.vector4D_0 = transformedOrigin; this.vector4D_1 = transformedXAxis; this.vector4D_2 = transformedYAxis; }
public MainViewModel(Map map, IBitmapProvider imageProvider, IBuildingCornersProvider cornerProvider) { Locations = LocationsController.Instance; InitializeBehaviors(cornerProvider); MapController.CreateMapController(map); ImageController.CreateImageController(imageProvider); Image = ImageController.Instance; Map = MapController.Instance; GotoRhitCommand = new RelayCommand(p => GotoRhit()); List <RhitLocation> locations = DataCollector.Instance.GetAllLocations(null); if (locations == null || locations.Count <= 0) { DataCollector.Instance.UpdateAvailable += new ServiceEventHandler(OnLocationsRetrieved); } else { OnLocationsRetrieved(this, new ServiceEventArgs()); } }
/// <summary> /// Gets provider for consumer /// </summary> /// <param name="provider">Provider</param> /// <param name="consumer">Consumer</param> /// <param name="mutipleProviders">The multiple providers flag</param> /// <returns>The provider</returns> public static IBitmapProvider GetProvider(IBitmapProvider provider, IBitmapConsumer consumer, bool mutipleProviders) { if (provider == null) { return(null); } if (!mutipleProviders) { if ((provider != null) & consumer.Providers != null) { // throw new Exception("Bitmap provider already exists"); } } ICategoryObject t = provider as ICategoryObject; ICategoryObject s = consumer as ICategoryObject; if (s.Object != null & t.Object != null) { INamedComponent ns = s.Object as INamedComponent; INamedComponent nt = t.Object as INamedComponent; if (nt != null & ns != null) { if (nt.Desktop == ns.Desktop) { if (nt.Ord >= ns.Ord) { throw new Exception(SetProviderBefore); } } else { if (nt.Root.Ord >= ns.Root.Ord) { throw new Exception(SetProviderBefore); } } } } return(provider); }
public Logic( IGraphProvider graphProvider, IBitmapProvider bitmapProvider, Log logger, Commands commands, ConnectionData connectionData) { GraphProvider = graphProvider; Bitmap = bitmapProvider.Bitmap; Logger = logger; Commands = commands; bitmapProvider.ShowBitmap(); graphProvider.ShowGraph(); _groundSprite = BitmapLoader.Load(SolutionDirectory.Get(@"Images\Shooter\Tiles\tile_05.png"), 16, 16); _waterSprite = BitmapLoader.Load(SolutionDirectory.Get(@"Images\Shooter\Tiles\tile_19.png"), 16, 16); _treeSprite = BitmapLoader.Load(SolutionDirectory.Get(@"Images\Shooter\Tiles\tile_183.png"), 16, 16); Commands.Login(connectionData.Host, connectionData.Port, connectionData.UserName, connectionData.Password); Logger.LogCommands = true; }
/// <summary> /// Post method /// </summary> protected virtual void Post() { if (!isSerialized) { return; } isSerialized = false; urls.Clear(); foreach (string textureName in dTextures.Keys) // Textures cycle { string providerName = dTextures[textureName]; // Name of provider if (providers.ContainsKey(providerName)) { IBitmapProvider p = providers[providerName]; // Bitmap provider if (p is IUrlProvider) { urls[textureName] = (p as IUrlProvider).Url; Bitmap bp = new System.Drawing.Bitmap(5, 5); paths.Remove(textureName); using (MemoryStream stream = new MemoryStream()) { bp.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp); // Saving bitmap to bypes textures[textureName] = stream.GetBuffer(); // Replace texture by bitmap } continue; } Bitmap bmp = p.Bitmap; // Bitmap of provider paths.Remove(textureName); using (MemoryStream stream = new MemoryStream()) { bmp.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp); // Saving bitmap to bypes textures[textureName] = stream.GetBuffer(); // Replace texture by bitmap } } } }
/// <summary> /// Ges name of provider /// </summary> /// <param name="provider">Provider</param> /// <returns>Name</returns> protected string GetName(IBitmapProvider provider) { IAssociatedObject ao = provider as IAssociatedObject; return(th.GetRelativeName(ao)); }
void IBitmapConsumer.Add(IBitmapProvider provider) { providers[GetName(provider)] = provider; addRemove(provider, true); }
/// <summary> /// Removes a provider /// </summary> /// <param name="provider">The provider</param> void IBitmapConsumer.Remove(IBitmapProvider provider) { this.provider = null; x = null; y = null; }
/// <summary> /// Adds a provider /// </summary> /// <param name="provider">The provider</param> void IBitmapConsumer.Add(IBitmapProvider provider) { this.provider = provider; }
/// <summary> /// Adds a provider /// </summary> /// <param name="provider">The provider</param> void IBitmapConsumer.Add(IBitmapProvider provider) { this.provider = provider; Bitmap = provider.Bitmap.Clone() as Bitmap; }
public static void CreateImageController(IBitmapProvider imageProvider) { _instance = new ImageController(imageProvider); }
public void Set(IBitmapProvider provider, int interval = 42) { Renderer = new BitmapRenderer(this, provider, interval); }
/// <summary> /// Gets bitmap of bitmap provider /// </summary> /// <param name="provider">The provider</param> /// <returns>The bitmap</returns> public static Bitmap GetBitmap(this IBitmapProvider provider) { return(provider.Bitmap); }