fix: better Image loading
This commit is contained in:
1
CarManagerV2/CarCard.Designer.cs
generated
1
CarManagerV2/CarCard.Designer.cs
generated
@@ -82,6 +82,7 @@
|
||||
this.pbxCar.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pbxCar.Image = ((System.Drawing.Image)(resources.GetObject("pbxCar.Image")));
|
||||
this.pbxCar.ImageLocation = "";
|
||||
this.pbxCar.InitialImage = ((System.Drawing.Image)(resources.GetObject("pbxCar.InitialImage")));
|
||||
this.pbxCar.Location = new System.Drawing.Point(3, 3);
|
||||
this.pbxCar.Name = "pbxCar";
|
||||
this.pbxCar.Size = new System.Drawing.Size(204, 124);
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace CarManagerV2
|
||||
|
||||
public async void LoadImage()
|
||||
{
|
||||
this.CarImage = pbxCar.InitialImage; // Set to loading image
|
||||
await Task.Run(() =>
|
||||
{
|
||||
Image img = ImageManager.GetImage(this.Car);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -72,11 +72,6 @@ namespace CarManagerV2
|
||||
StateManager.UpdateCar(car);
|
||||
Console.WriteLine("Saved car: " + car.Id);
|
||||
});
|
||||
await Task.Run(() =>
|
||||
{
|
||||
ImageManager.GetImage(car);
|
||||
Console.WriteLine("Updated image for car: " + car.Id);
|
||||
});
|
||||
Console.WriteLine("Car saved. " + car.Id);
|
||||
btnSave.Enabled = true;
|
||||
btnDelete.Enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user