05-07-2005, 09:05 AM
nope...
Include binaries...
|
05-07-2005, 09:05 AM
nope...
05-07-2005, 09:39 AM
The Win API is a ..., if i remember the bitmaps had to be converted to DC's and such, but i don't know GDI too much, sorry.
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
05-08-2005, 12:34 AM
As per the MSDN documentation (it's actually quite good ), you need to send an icon handle - not a pointer to the data. See the CreateIcon function.
05-08-2005, 02:02 AM
Thank you both.
looked a little deeper and yes, the raw data can't be used, have to use win API. CreateIcon is used when creating a new empty icon, but in this case we have already the icon data in memory. Found out a DIB image needs to be created with CreateDIBitmap. This command is used for bitmaps, icons etc. and takes a memory address with the raw data (well actually a little more...). Hope to get it going... ...why needs every thing to be so complicated :???:
05-08-2005, 03:20 AM
Hallo fsw,
it's easy to show the application-icon: Code: ~CreateWindow("STATIC", "#1", _ To add the icon to the application just create a textfile with one line like this: Code: IDI_ICON1 ICON DISCARDABLE "MyIcon.ico" Save it as with the Notepade as "*.rc", for example "MyIcon.rc". If you start "fbc.exe", then add the "MyIcon.rc" to the commandline like: fbc test.bas -s gui MyIcon.rc For Icon-Programming-Examples download the api-guide here: http://www.mentalis.org/agnet/appdown.shtml After installing let the programm search for all API-Function that included the word "Icon" and then click in "example" and you'll the how to use it (the examples are in Visual-Basic). Kind regards from Germany Peter
erman freeBASIC-mailinglist: de.groups.yahoo.com/group/free-basic.
For subscribing send an empty e-mail to free-basic-subscribe@yahoogroups.de.
05-08-2005, 03:39 AM
Thanks Peter,
but you missed the whole point here. I know how to use resources, rc, res etc. files. Done it 1000 times, this is not the problem. The point here is to NOT USE RESOURCES, but store the images (or whatever) into the exe and access them. (as I said in the first post...) This way it's harder for others to manipulate the images used by the program.
05-08-2005, 12:29 PM
Well, you could:
1. compile your bas file 2. get the size of the exe 3. append the data to the exe 4. open your exe as a data file in the exe itself 5. seek exesize 6. read from there
05-08-2005, 01:52 PM
Yes relsoft, that is working, just append it at the exe, I'm doing it with my Setup-Programm also, I just append the zip-file at the setup.exe.
Mostly an Icon is 766 byte, so just start at "FileLen()-766" to read the data. Don't forget: today is mother's day (at least in Gemany)! ;-) Kind regards Peter
erman freeBASIC-mailinglist: de.groups.yahoo.com/group/free-basic.
For subscribing send an empty e-mail to free-basic-subscribe@yahoogroups.de.
05-17-2005, 11:10 PM
Vic, can I do it that way?
Code: dim bmpaddress as ubyte ptr = @bitmap_data(0) my problem is that the address of bitmap_data(0) and pbfileh are not the same. And because of this, while using CreateDIBitmap, it's not working. Here the code with CreateDIBitmap: Code: dim bmpaddress as ubyte ptr = @bitmap_data(0) If I can get the pointer stuff ironed out I should be able to Create a Bitmap from the data inside the exe.
05-18-2005, 12:43 AM
BYREF args fault again.. i hate those suckers. This test worked fine:
Code: option explicit
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php
|
« Next Oldest | Next Newest »
|