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 / Save image to memory

Author
Message
appie21
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 6th May 2013 09:25
Hello

I have load two images and paste them on to the screen
Now I wiil save them together as one image. I now save it to my hard disk but i will safe it to the internal memory, (it is in a loop) I need the saved image later in my program again? how can I do this?
here is the code

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 6th May 2013 12:20
You have to GET image, before you can SAVE image.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th May 2013 17:17
And you probably need to use a new image id, e.g. 3 in the first instance. Do you really want to get a new image every loop?

If so then something like this should work:

appie21
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 9th May 2013 17:28
Hello
Thanks al!

I have made a image and add to this post.
Sorry for my bad English hope you undertand it
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th May 2013 02:33
You can probably modify my example to do that.
suawer
13
Years of Service
User Offline
Joined: 5th Jun 2013
Location:
Posted: 5th Jun 2013 07:20
Confused, to save two images as one means merging them into one image? If it is ,as far as I know, only an image editor could make this happen.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 5th Jun 2013 15:38 Edited at: 5th Jun 2013 15:41
You can use Set Current Bitmap as well to copy from one bitmap to another bitmap.

So

Pseudo Code (not real code)...

Sync On
Set Current Bitmap 1
Get Image X Y etc
Set Current Bitmap 0
Paste image X Y.... Or use the image as a Sprite
Sync

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 5th Jun 2013 20:25 Edited at: 5th Jun 2013 20:25
Quote: "Confused, to save two images as one means merging them into one image?"

Exactly..!! That is the way.

Imagine that we have an image with a tree...just a tree and the rest of image is pure black. This image is ...let say 100*100 ,and we want to paste into another image let say 100*100 (second image could be bigger). We can do this with a FOR/NEST ...



The cromakey could be any colour, so instead of blue I have use just black in this example. We copy every pixel that its value is higher than 0 (black), and paste just 100 units on the second image...lastly we get the third image..


Cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-08 00:24:58
Your offset time is: 2026-07-08 00:24:58