Ejemplo n.º 1
0
  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);
  }
Ejemplo n.º 2
0
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");
}
Ejemplo n.º 3
0
 bool LoadFile(const TCHAR *path) {
   Invalidate();
   return bitmap.LoadFile(path);
 }