April 27, 2024, 06:21:51 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Refreshing bitmap resources in a project

Started by barry, January 25, 2007, 09:17:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

barry

I have a project with, currently, about a dozen bitmap resources, and it'll soon have quite a few more.  As I work on it, knowing little about the ins and outs of Windows bitmaps or much else about GUI programming, I keep having to make little changes in the bitmaps for one reason or another.  Each time I do I'd like to be able to rebuild the project without having to delete all the resources and add them back in, which is a pain when I do it a bunch of times.  Is there a way to do that?

By the way, I realize that the usual way to do something like this is probably to have bitmap files and load them at run time instead of using resources but I'd like to do it with resources in this case; partly to learn about resources and also because this is a program I plan to use for myself and it'll be handier for me like this.  Also, sharing it with some friends will be easier this way.

Barry

Steve Rusich

What I usally do in the case I have a lot of bitmaps is to write a single sub that will load the pictures straight from the development folder I am using. Once I am done tweaking the bitmaps I change the sub to load the bitmaps as a resource.

Steve


Quote from: barry on January 25, 2007, 09:17:31 AM
I have a project with, currently, about a dozen bitmap resources, and it'll soon have quite a few more.  As I work on it, knowing little about the ins and outs of Windows bitmaps or much else about GUI programming, I keep having to make little changes in the bitmaps for one reason or another.  Each time I do I'd like to be able to rebuild the project without having to delete all the resources and add them back in, which is a pain when I do it a bunch of times.  Is there a way to do that?

By the way, I realize that the usual way to do something like this is probably to have bitmap files and load them at run time instead of using resources but I'd like to do it with resources in this case; partly to learn about resources and also because this is a program I plan to use for myself and it'll be handier for me like this.  Also, sharing it with some friends will be easier this way.

Barry

Today I achieved unprecedented levels of unverifiable productivity.

LarryMc

QuoteWhat I usally do in the case I have a lot of bitmaps is to write a single sub that will load the pictures straight from the development folder I am using. Once I am done tweaking the bitmaps I change the sub to load the bitmaps as a resource.
Good idea Steve
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

mrainey

If you change a bitmap but keep the original path and filename, why do you have to do anything more than just rebuild the project?
Software For Metalworking
http://closetolerancesoftware.com

Steve Rusich

Quote from: mrainey on January 25, 2007, 02:04:44 PM
If you change a bitmap but keep the original path and filename, why do you have to do anything more than just rebuild the project?

When you add a bitmap as a resource to your project, any later editing to the orignal bitmap is not part of the resource bitmap.

Steve
Today I achieved unprecedented levels of unverifiable productivity.

mrainey

Maybe I'm misunderstanding the question.

If I have a resource bitmap of a horse, called horse.bmp - I see a picture of a horse when I run my program.

If I delete horse.bmp from my hard drive and copy a picture of a cow to the directory where horse.bmp had been, and I name the picture of the cow as horse.bmp - I see a picture of a cow in my program after I rebuild the project.  I haven't deleted or modified my resource definitions in any way - just changed the content of the bitmap.
Software For Metalworking
http://closetolerancesoftware.com

barry

Quote from: Steve Rusich on January 25, 2007, 10:53:27 AM
What I usally do in the case I have a lot of bitmaps is to write a single sub that will load the pictures straight from the development folder I am using. Once I am done tweaking the bitmaps I change the sub to load the bitmaps as a resource.

I want to end up with a single executable file and nothing else.  I may misunderstand your reply but if I understand it correctly it won't give me that.

Barry

barry

Quote from: mrainey on January 25, 2007, 02:35:59 PM
Maybe I'm misunderstanding the question.

If I have a resource bitmap of a horse, called horse.bmp - I see a picture of a horse when I run my program.

If I delete horse.bmp from my hard drive and copy a picture of a cow to the directory where horse.bmp had been, and I name the picture of the cow as horse.bmp - I see a picture of a cow in my program after I rebuild the project.  I haven't deleted or modified my resource definitions in any way - just changed the content of the bitmap.

Maybe I'm doing something wrong but it doesn't seem to work that way for me.  That's what I expected and I think it probably is how it should work but I don't know how to make it happen.

Barry

mrainey

For me it's just:

Modify and save bitmap - keep name and path the same as before

Click the Compile and Execute toolbar button - modified bitmap displays properly in my program.


Wish I could help you figure out what's wrong.

Software For Metalworking
http://closetolerancesoftware.com

Steve Rusich

Quote from: barry on January 25, 2007, 03:40:25 PM
Quote from: Steve Rusich on January 25, 2007, 10:53:27 AM
What I usally do in the case I have a lot of bitmaps is to write a single sub that will load the pictures straight from the development folder I am using. Once I am done tweaking the bitmaps I change the sub to load the bitmaps as a resource.

I want to end up with a single executable file and nothing else.  I may misunderstand your reply but if I understand it correctly it won't give me that.

Barry


There seems to be some confusion on what is meant by a "resource". In the Emergence BASIC IDE there is a menu option to load resources into your project. All these "resources" can be almost anytype of datafile such as bitmaps, sound files, etc. When the "project" is compiled, it is all included into a single .EXE program.

My original post stated that I would load bitmaps into the program straight from the same development folder as the program source code. I did this during the phase of the coding project when I was routinely changing the bitmap pictures. When I was done editing the bitmap pictures, I would load the bitmaps into the project as a resource then change my source code to load the pictures into my program as a resource.

Clear as mud?
Today I achieved unprecedented levels of unverifiable productivity.

barry

Well, it seems the problem is the guy behind the wheel; me. :)

I tried changing the bitmaps and rebuilding the project and sure enough it worked.  Why that didn't happen before I don't know.

Anyway, it's fine now.  Thanks for your help.

Barry