Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bitmap::fromFile(L"") blocking a .bmp file

Featured Replies

Hi I posted few weeks ago a msg about the blocking of an .bmp file when I load it with GDI+ function BitmaP::fromFile(L""), so I tried something suggest that was creating a temp .bmp file, I did it, but I still need to refresh the .bmp loaded on GDI+, so is there a way to UNLOCK the image and reload it???, Im programing a gauge with C.Thank you in advance!! please help!!!Rafa =)

Hi all!!!I FINALLY FOUND THE SOLUTION TO MY PROBLEM:Image *_img;_img = new Bitmap(L"img.bmp");graphics.DrawImage(_img, destination);_img->~Image(); <--- destructor!!well, thanx to everyone in the previous posts!!, byeRafa

Hmmm..Calling the destructor explicitly is a bad idea. The destructor will be called when _img goes out of scope, and cause you problems that you will not see.Also, as I mention before, you should NOT name variables with a leading underscore (_) character. That is reserved for certain systems programming and considered very bad form.Try this:{ myImg = new Bitmap(L"img.bmp"); graphics.DrawImage(myImg, destination); delete myImg; // <----- Will allow you to now assign new pointer myImg = NULL; // Make sure it doesn't point to anything // Now you can use it again if needed myImg = new Bitmap(L"another.bmp"); graphics.DrawImage(myImg, destination);} // <--- Destructor will be called hereGood luck.

Hi Patrick!!!Well, I will change my var's names right away! =), u told me that before but I was so worried about I couldn't load my .bmp that I didnt pay attention to ur suggestion, thank u =).Well, what if i have that loading inside a time conditionallike:if(time1.var_value.n == time2){ myImg = new Bitmap(L"img.bmp"); graphics.DrawImage(myImg, destination); delete myImg; // <----- Will allow you to now assign new pointer myImg = NULL; // Make sure it doesn't point to anything}will that still unlock the .bmp file?????, so I can modify it?Well I'm going to test it, and I'll tell u what happened!!Thank you for your great help Patrick!!Rafa

Well it works nice!! =)what I did:if(time1.var_value.n == time2){time3 = time1.var_value.n + 72;img = new Bitmap(L"img.bmp");graphics.DrawImage(img, destination);//img->~Image();delete img;img = NULL; }///endifThank you very much Patrick!!!!Rafa

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.