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.

Newcomers DBPro Corner / DB Pro command syntax

Author
Message
xmajiconex
1
Years of Service
User Offline
Joined: 9th Dec 2022
Location:
Posted: 17th Feb 2023 19:37
i am using editor 10/02/2008 with compiler v1.071

i load 5 images
i paste 5 images
user picks one image [a] [b] [c] etc
once chosen , an action occurs and when done image chosen disappears
i use the delete image # command but the image stays
delete image command has no effect
is there something wrong with my version of DB Pro or is it something else

confused

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Feb 2023 19:41
Try DeleteSprite() then DeleteImage()
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Feb 2023 21:21 Edited at: 18th Feb 2023 02:26
moved to DBPro Newcomers (from AGK).

meanwhile, i haven't used DBPro in ages so i'm no direct help but i want to make that you know that the author of the Hands On DBPro ebooks has recently made them available for free which is a great boon for DBPro newcomers like yourself; see this thread.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 18th Feb 2023 16:29
2D Commands in Dark BASIC Professional use the Windows Canvas rather than Direct2D., this means that they will not automatically clear from the Draw Buffer (see: Bitmap) when you call Sync.





This is a simple example., where you press the Spacebar to Hide / Show the Image
Whenever the Image is unhidden, it will move across the screen.

Look at what happens with CLS commented out., and then when you uncomment it.
You can also comment out everything except Sync, and uncomment the Paste Image outside of the loop

While it won't move., notice how it will always render regardless of how many times the App is syncing.
Now the one outside the Loop IF you use Sync On and set a Sync Rate., will flicker because VSync Requires a Double Buffer; but we're only Drawing to a Single Buffer rather than the Active Buffer (out of 2)... thus one is blank and the other is filled.

Hopefully with the example code this all makes a bit more sense.
In any case you should just not paste the image rather than delete it... as Loading and Deleting are performance intensive tasks.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 23rd Feb 2023 08:34

Login to post a reply

Server time is: 2024-11-17 20:24:20
Your offset time is: 2024-11-17 20:24:20