Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / imbedding pictures

Author
Message
CloseToPerfect
22
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 18th Feb 2003 07:59
you know how with the editor you can inculde a file as data in bytes, If you take a .bmp file convert to data and have it embedded in your code how can you then make a image from this data to use, I tried reading the data into memblocks and using make image fom memblock, but I must not be doing something right..?? Any help on this would be apperiated.
thanks
john
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Feb 2003 14:52
Don't do it that way.

Make sure you are running the DBPro editor in Project mode.
Click on the Media button in the Project manager pane.
Click on the add button ...

You can work it out from there I'm sure
CloseToPerfect
22
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 18th Feb 2003 17:46
I don't want this added as media, It's just a few small icons I need embedded in the program.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Feb 2003 19:32
Why not? If you do a final build (exe with attached media) all media is included in the exe automatically.

Otherwise, the way I'd do it would be to have a program (written in DBPro) that loaded the image, converted it to a memblock, then write out all of the byte values to a text file as data statements, which I could then #include in my source.

I wouldn't just convert the bitmap to data statements directly, as that would contain a lot of information that you would have to decipher instead of letting DBPro doing for you.

It all seems like a lot of bother to me.
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 18th Feb 2003 19:50
Read the icon files into an array or do this one word at a time.
Read the word from the icon file
scramble it
then put it into a memblock.
Add all the scrambled icons into the same memblock at different offsets.
Save the memblock as a datafile "secret_icons".
Add this fiel to your media section.
(That's kind of tricky...
select all files
in the file descriptor change *.* to *
it then "secret_icons"
will show up to select to add.)
When your program executes,
read the "secret_icons" file into a memblock
extract the three icons and create your bitmaps.

Works for me.

The more you see, the more you know.
The more you know, the more you see.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 18th Feb 2003 19:58
do you want to use the icons for the program exe or do you require the within the program?
personally i'd do basically as what heartbones done and use a memblock to combine them all and then i'd figure out some format for them ... export them all to a single file of icons

or you could embed the data into well erm data streams,
you just export as
data something,something,something

into a file you name dba or something and then just include this file normally and you can use the data statments then to recreate the icons... its a long way around but good enough for embedding.

could also use a packer, i mean db std/ehd/pro all have some cool features for packing data into files.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
CloseToPerfect
22
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 19th Feb 2003 01:13
ok heres the whole story of what I'm tring to do and why.

look


ok I have a set of menu bar functions I made as a include file. I have several predifined icons built into it with the abality to load user picture. Currently I store the pictures in the program as simple data,(not in r,g,b format, just b/w) and load the data into an array. With lock/unlock pixels my 1gig computer loses about 1 fps for each icon it draw (no problem thats fast), but I would lick to add a few color icons to this which will slow this down alot creating the rgb changes for each pixel. There are at least 10 people other then myself using these function, and I want these predifine icons to be built in to the code for hassle free usage. I belive if I can convert this to a image without have to draw it and get image it, it will be faster for all of them, for sure the color ones. There has got to be a way to convert the data for the bmp file back into a image in memory, I'm sure using make image from memblock would work, unless it's buggy. I just can't figure it out.
The picture shows a check mark icon that I draw with dot x,y. Thats an example of what I'm shooting for.

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th Feb 2003 01:31
actually i've recently been doing this same kinda thing
and i've found its far quicker to actually plot the entire picture within a memblock rather than messing about with the dot x,y command.

i'll show you the current results





now basically i created my own versions of the Dot, Line, Box and Circle commands which will plot themselves directly into a memblock which is then passed over to the background image - so really almost everything you see is part of the background image, however thanks to professional multiple cameras i can setup the images/bitmaps for the background per camera
it also means no faking windows and such because they can all be created with the seperate cameras.
(this will be alot easier if/when pro gets window instances)

i'm not sure how many windows professional is capable of, so tool windows are managed with seperate memblocks being allowed upto 255/window and 255 camera/program

hopefully that many will never be required, and each one can get memory instensive - but hopefully that isn't a problem for smaller programs ... i mean most will limit themselves to the windows allowed open (i hope)

but you have the main window which takes around 700kb-3mb in memory (depending on the screensize) then you have the multiple windows which also can take around as much.

i have been wondering to save ram and other thing using 3D plains for the 2D stuff like floating bars and such, rather than combineing the images based on position - but i'm pretty sure that doesn't work well with other cameras
right now the mouse is a sprite so it goes over everything as are the dropside menus (^_^)

but its all about how you setup the data really

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
CloseToPerfect
22
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 19th Feb 2003 03:20
"actually i've recently been doing this same kinda thing
and i've found its far quicker to actually plot the entire picture within a memblock rather than messing about with the dot x,y command." --raven

no shit, That's why I said I want to do it. Can you post your dot to memblock function? please, thank you

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th Feb 2003 03:29
it not all that hard actually
all you're doing is offsetting the original position by 12



that'd do it quite well
only if you use either 16 or 32 bit colour, but as thats only what Pro and Enhanced use its all good (^_^)

the harder ones are the line and box commands lol

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th Feb 2003 03:35
lmao... oki that would work only for 16bit... that should read



you know i wonder how you can check to see if something is already globally used ... i mean in C++ you have #ifdef so be cool to have something like that in pro

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th Feb 2003 03:37
oh yeah... any comments on my User Interface System?
i liked the style of Media Player 9's standard skin so just edited alot up, and took alot of hours over the past 2days to get the colours and rasterisations working nicely

be cool to know what ya think about the look

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
TheCyborg
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 19th Feb 2003 14:18
WoW Raven ... I think your interface looks really cool, nice, tidy and professional...
Keep up the good work.

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 19th Feb 2003 15:05
I thought that reminded me of WMP 9

Visit [url]www.lightning-systems.co.uk[/url]
You are the th person to view this signature.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 19th Feb 2003 20:03
the original look actually started off using something else pretty similar from the AmigaOS, but then i saw Media Player Series 9 ... and couldn't help myself (^_^)

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2025-05-18 07:59:56
Your offset time is: 2025-05-18 07:59:56