/// <summary> /// Called when a selection of the station has changed. /// </summary> private void onStationChanged(object sender, EventArgs e) { // Builds a new preview bitmap and set it to the picture box PreviewDrawer drawer; if (selectedStation == null) { drawer = new PreviewDrawer(stationPicture.ClientSize, new Distance()); } else { drawer = new PreviewDrawer(stationPicture.ClientSize, selectedStation.Size); drawer.DrawCenter(selectedStation.Sprites); } if (stationPreviewBitmap != null) { stationPreviewBitmap.Dispose(); } stationPicture.Image = stationPreviewBitmap = drawer.CreateBitmap(); drawer.Dispose(); updateAlphaSprites(); }
/// <summary> /// /// </summary> /// <param name="pixelSize"></param> /// <returns></returns> public override PreviewDrawer CreatePreview(Size pixelSize) { PreviewDrawer drawer = new PreviewDrawer(pixelSize, size); drawer.DrawCenter(sprites); return(drawer); }