Dark Bit Factory & Gravity

PROGRAMMING => Freebasic => Topic started by: Dr_D on December 19, 2006

Title: Fun with FB's gfxlib...
Post by: Dr_D on December 19, 2006
I didn't post a screenshot because it requires the whole desktop. :stirrer:

Basically, it uses some of the new gfxlib functions to create a flag that scrolls around the screen. It kinda simulates a screensaver.
Title: Re: Fun with FB's gfxlib...
Post by: DrewPee on December 19, 2006
You certainly are posting some cool stuff Mr_D!!  :goodpost:

When you say this code uses some of the gfxlib functions - do you mean in a new version of FreeBasic or . . . just a new lib - perhaps it is something i have missed!!!

Drew
Title: Re: Fun with FB's gfxlib...
Post by: DrewPee on December 19, 2006
sorry - meant to say Dr_D - not Mr_D - my apologies!!!  :whack:

Drew
Title: Re: Fun with FB's gfxlib...
Post by: Clyde on December 19, 2006
Wow Dr D dude, thats really cool. Welldone :)
Title: Re: Fun with FB's gfxlib...
Post by: Shockwave on December 19, 2006
I didn't know you could draw stuff over the desktop like that with FB :) + Karma.
Title: Re: Fun with FB's gfxlib...
Post by: .:] Druid [:. on December 19, 2006
really excellent stuff!  thanks for sharing!
Title: Re: Fun with FB's gfxlib...
Post by: Dr_D on December 19, 2006
Thanks guys. ;) It's from the current version of FB, which is different from the stable and testing releases. Those functions are part of the new inherent gfxlib. You don't need to include any external libraries. :)
Title: Re: Fun with FB's gfxlib...
Post by: psygate on December 29, 2006
man... thats a great job!

*applaude* -> pushing button

but, I just cant compile it.... im using freebasic v 0.17b
Title: Re: Fun with FB's gfxlib...
Post by: Jim on December 29, 2006
Lots of people won't install 0.17 yet as it's still beta.  It's possible to have 2 versions of FB installed in different folders if you want to get 0.16 as well, because that's what most people are still using until the final of 0.17 comes out.

Jim
Title: Re: Fun with FB's gfxlib...
Post by: Dr_D on December 29, 2006
Indeed. Also, you can get a daily build here...

http://ecowles.dyndns.org/fbdu/

Eric Cowles, aka 1000101, has set this thing up to do it automatically. I couldn't get it to work straight off though. It seems there are some files needed that only come with the versions that v1c uploads.

Here's exactly what I did...

1) Create a folder like, "C:/DailyFB"
2) Copy the contents of your original FreeBASIC folder to this new one.
3) Download the large package from that site.
4) Extract it to the new directory, answering yes to all when it asks to overwrite.

Don't foget to report if you find any bugs... that's what it's all about, ya know? :D
Title: Re: Fun with FB's gfxlib...
Post by: psygate on December 30, 2006
Yeah, thanks, I did it, even before you posted that :2funny: Just used the 'search' function on freebasic.net :cheers: :updance: :updance:
Title: Re: Fun with FB's gfxlib...
Post by: Dr_D on December 31, 2006
So, you're able to use the new stuff now? :D

The only thing I wish it had was the ability to read the desktop pixel color. It would be reeaalllly fun to make some funky screensavers using a snapshot of the desktop!  Lens map the desktop?!!  :updance:
Title: Re: Fun with FB's gfxlib...
Post by: Jim on December 31, 2006
If you can use Windows API, then GetDC(NULL) gets you the desktop HDC and then you can jigger with the bitmap and finally use GetDIBits(...) to retrieve the current desktop bitmap.  Then open a fullscreen popup window and draw the desktop into that however you like it.
http://www.google.com.au/search?hl=en&q=desktop%20getdc(null)%20getdibits&ie=UTF-8&oe=UTF-8&sa=N&tab=gw (http://www.google.com.au/search?hl=en&q=desktop%20getdc(null)%20getdibits&ie=UTF-8&oe=UTF-8&sa=N&tab=gw)

Jim
Title: Re: Fun with FB's gfxlib...
Post by: psygate on December 31, 2006
Yeah, it would be really cool to take a screenshot of the desktop and have fun with it....

The API could do that, but im not so familiar with it, im happy if i can write a program which lets a pixel fly over the screen :||

BUT you could try to do a screenshot with irfan view and then send it to your program, I did this once, if I can find the source, I'll post it here!
Title: Re: Fun with FB's gfxlib...
Post by: Dr_D on December 31, 2006
Yeah, it would be really cool to take a screenshot of the desktop and have fun with it....

The API could do that, but im not so familiar with it, im happy if i can write a program which lets a pixel fly over the screen :||

BUT you could try to do a screenshot with irfan view and then send it to your program, I did this once, if I can find the source, I'll post it here!

Man, that would be awesome! If there was a way to get a cross-platform desktop pic though... :D
Title: Re: Fun with FB's gfxlib...
Post by: psygate on December 31, 2006
Ok, I couldn't find the source but I figured out how I did it, so here my step plan to get a screenshot of the desktop:

1.) Write your program and include irfan view.
2.) Let your program start irfan view when it's executed
3.) Send the key which is defined to perform the action of a screenshot into the key-buffer
4.) Let Irfan view save the screenshot in your directory
5.) Close Irfan View
6.) Load the screenshot.

It's not the best way, but its ONE way. I'll gather some informations about screening the desktop, If i  find something, I'll post it! :cheers: