• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

unloading resource bitmap from Image1.picture.bitmap

I have image1 on the form.
a bitmap is loaded runtime like this:
form1.Image1.Picture.Bitmap.LoadFromResourceName(hinstance, 'MYPIC');
now i need to unload the bitmap(MYPIC) and load the image1 with another bitmap 'HISPIC'.
I tried all possible procedures that come after form1.Image1.Picture.Bitmap. but nothing works. all raise access violation exceptions.
0
oalawna
Asked:
oalawna
  • 4
  • 2
1 Solution
 
kretzschmarCommented:
try

Image1.Picture := nil;

meikl ;-)
0
 
oalawnaAuthor Commented:
thanks
:-)
0
 
kretzschmarCommented:
above was to clear

to load another just use (a clear is not needed then)

Image1.Picture.Bitmap.LoadFromResourceName(hinstance, 'HISPIC');

you may notice that i left out the form1,
because as long as u do it in the same object-instance,
it is not needed, and it may be that the default-reference-variable is not used

meikl ;-)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
kretzschmarCommented:
hups, that was fast :-))
0
 
oalawnaAuthor Commented:
Yes I know but i wanted to clear it like clearing labels for example. Nil works:-)
regards
0
 
kretzschmarCommented:
yep, thats the way to clear

glad to helped you

meikl ;-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now