: Perhaps the TBitmap.LoadFromResourceName() will do the trick. Also you should check if the resource is correctly added to the program code.:

Thanks for your answer.

Yes I already tried LoadFromResourceName and some other things as well. The only way I know to check the validity of the bitmap is to reopen the resource file in the Delphi Image editor and then go to EDIT the bitmap. If it's able to open it, I take it to be valid. Maybe I'm wrong on that.

: : Perhaps the TBitmap.LoadFromResourceName() will do the trick. Also you should check if the resource is correctly added to the program code.: : : : Thanks for your answer. : : Yes I already tried LoadFromResourceName and some other things as well. The only way I know to check the validity of the bitmap is to reopen the resource file in the Delphi Image editor and then go to EDIT the bitmap. If it's able to open it, I take it to be valid. Maybe I'm wrong on that.: I assume that you linked it into the source code using the $R directive.You can check if the resource exists in your app with the FindResource() function. Here is what the code should look like:[code] MyRes := FindResource(hInstance, PChar(MyResourceName), RT_Bitmap); if MyRes = 0 then ShowMessage('Error: resource doesn't exist') else // Use resource;[/code] You can find more info on the function in the Windows SDK help files.

: I assume that you linked it into the source code using the $R directive.: You can check if the resource exists in your app with the FindResource() function. Here is what the code should look like:: [code]: MyRes := FindResource(hInstance, PChar(MyResourceName), RT_Bitmap);: if MyRes = 0 then: ShowMessage('Error: resource doesn't exist'): else: // Use resource;: [/code] : You can find more info on the function in the Windows SDK help files.:

Thanks again for your input. I added your code to my procedure and I get the same result. MyRes returns a non-zero number. Here's the code.

: : I assume that you linked it into the source code using the $R directive.: : You can check if the resource exists in your app with the FindResource() function. Here is what the code should look like:: : [code]: : MyRes := FindResource(hInstance, PChar(MyResourceName), RT_Bitmap);: : if MyRes = 0 then: : ShowMessage('Error: resource doesn't exist'): : else: : // Use resource;: : [/code] : : You can find more info on the function in the Windows SDK help files.: : : : Thanks again for your input. I added your code to my procedure and I get the same result. MyRes returns a non-zero number. Here's the code.: : implementation: : {$R *.dfm}: {$R Nikud.res}{ <--- This is the Resource File }: : procedure TForm1.FormCreate(Sender: TObject);: var: HebRes : TResourceStream;: MyRes : Integer;: begin: HebRes := nil;: try: MyRes := FindResource(hInstance, PChar('DAGESH'), RT_Bitmap);: if MyRes = 0 then: ShowMessage('Error: resource doesn''t exist'): else begin: HebRes := TResourceStream.Create(HInstance,'DAGESH',RT_Bitmap);: HebRes.Position := 0;: {Next line gives ERROR: "Bitmap Image is not valid"}: Image1.Picture.Bitmap.LoadFromStream(HebRes);: ImageList1.AddMasked(Image1.Picture.Bitmap,clWhite);: end;: finally: if HebRes <> nil then HebRes.Free;: end;: end;: : end.: : : Perhaps you could try to use the LoadResource() function, and then set the resulting handle to the bitmap in your image.If that doesn't work, then all I can suggest is that you add a new hidden image to your form and load the bitmap into it. Then you can simply copy the bitmap from one image to the other. That will certainly work.

: I assume that you linked it into the source code using the $R directive.: You can check if the resource exists in your app with the FindResource() function. Here is what the code should look like:: [code]: MyRes := FindResource(hInstance, PChar(MyResourceName), RT_Bitmap);: if MyRes = 0 then: ShowMessage('Error: resource doesn't exist'): else: // Use resource;: [/code] : You can find more info on the function in the Windows SDK help files.:

I just tried loading an ICON and it fails with or without the "FindResource" saying the "Resource does not exist". But when I look at the EXE in EXPLORER it's using the ICON that supposedly doesn't exist.