void UpdatePreview(Path path) { preview_widget->SetBitmap(nullptr); preview_bitmap.Reset(); try { if (!preview_bitmap.LoadFile(path)) return; } catch (const std::exception &e) { return; } preview_widget->SetBitmap(preview_bitmap); }
static void Main() { Bitmap bitmap; bool success = #ifdef USE_GDI id.IsDefined() ? bitmap.Load(id) : #endif bitmap.LoadFile(path); if (!success) fprintf(stderr, "Failed to load image\n"); }
bool LoadFile(const TCHAR *path) { Invalidate(); return bitmap.LoadFile(path); }