User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 28 Nov 2003, 23:38   #1
Seed of Chaos
Pr0f3ss10na1 P30n
 
Join Date: Jun 2000
Location: UK
Posts: 221
Seed of Chaos will become famous soon enoughSeed of Chaos will become famous soon enough
Lightbulb Random wallpaper changer

Does anyone know where I can download a free random wallpaper changer that can handle not just bmp files but jpgs as well?
__________________
Internet gamers can be split into 2 groups: people who are playing Planetarion, and people who had been playing Planetarion
Seed of Chaos is offline   Reply With Quote
Unread 28 Nov 2003, 23:40   #2
SYMM
Love's Sweet Exile
 
SYMM's Avatar
 
Join Date: May 2001
Location: Living on a Stair (Now Sword-less)
Posts: 2,371
SYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better place
Re: Random wallpaper changer

A program called Webshots can do stuff like that i believe...
__________________
--SYMM--
Ba Ba Ti Ki Di Do
SYMM is offline   Reply With Quote
Unread 28 Nov 2003, 23:45   #3
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Random wallpaper changer

Because Google couldn't have answered this at all
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 29 Nov 2003, 13:07   #4
Seed of Chaos
Pr0f3ss10na1 P30n
 
Join Date: Jun 2000
Location: UK
Posts: 221
Seed of Chaos will become famous soon enoughSeed of Chaos will become famous soon enough
Re: Random wallpaper changer

well, I'm crap at searching for stuff - they keep on giving me the wrong results. Maybe I'm just crap at coming up with the right key words
__________________
Internet gamers can be split into 2 groups: people who are playing Planetarion, and people who had been playing Planetarion
Seed of Chaos is offline   Reply With Quote
Unread 4 Dec 2003, 22:32   #5
Cyp
∞+♪˛
 
Join Date: Nov 2000
Location: :uo!te]oŻ|
Posts: 428
Cyp is an unknown quantity at this point
Re: Random wallpaper changer

This should work, and it doesn't even need input bmp or jpg files. Don't know if it works with GCC, I made it a long time ago.

Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

#define mlx 3
int scx, scy, mly, ofs;
unsigned char *scr;
unsigned char sct[160*120*3];
#define bmfh ((BITMAPFILEHEADER *)scr)
#define bmih ((BITMAPINFOHEADER *)&scr[sizeof(BITMAPFILEHEADER)])

#define pts 12
double px[64], py[64], pca[64], pcb[64], pcc[64];

double cca, ccb, ccc;

void dodot(int, int, unsigned char *, unsigned char *, unsigned char *);

int WINAPI WinMain(HANDLE ha, HANDLE hrubbish, LPSTR cl, int sh)
{
 int x, y, z, w;
 double a, b, c, s, t, u;
 FILE *f;
  srand((unsigned)time(0));
  scx=GetSystemMetrics(SM_CXSCREEN);
  scy=GetSystemMetrics(SM_CYSCREEN);
  mly=(scx*3+3)&0xFFFFFFFC;
  ofs=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
  if((scr=(unsigned char *)malloc(mly*scy+ofs))==0) return(0);
  memset(scr, 0, mly*scy+ofs);
  bmfh->bfType=0x4D42;
  bmfh->bfSize=mly*scy+ofs;
  bmfh->bfOffBits=ofs;
  bmih->biSize=sizeof(BITMAPINFOHEADER);
  bmih->biWidth=scx;
  bmih->biHeight=scy;
  bmih->biPlanes=1;
  bmih->biBitCount=24;
  bmih->biCompression=BI_RGB;
  bmih->biXPelsPerMeter=bmih->biYPelsPerMeter=32768;
  cca=rand()%128+64;
  ccb=rand()%128+64;
  ccc=rand()%128+64;
  for(x=0;x<pts;++x) {
    px[x]=rand()%(160/*scx*/-1)+.5;
    py[x]=rand()%(120/*scy*/-1)+.5;
    do {
      a=rand()%1025-512;
      b=rand()%1025-512;
      c=rand()%1025-512;
    } while((s=a*a+b*b+c*c)>512*512||s<16*16);
    s=sqrt(s)/64.; a/=s; b/=s; c/=s;
    pca[x]=a; pcb[x]=b; pcc[x]=c;
  }
  for(x=0;x<160;++x) for(y=0;y<120;++y)
    dodot(x, y, &sct[x*3+y*480], &sct[x*3+y*480+1], &sct[x*3+y*480+2]);
  c=158.951231/(scx-1);
  s=118.951232/(scy-1);
  for(x=0;x<scx;++x) for(y=0;y<scy;++y) {
    a=x*c; b=y*s; z=(int)a*3+(int)b*480;
    t=modf(a, &a); u=modf(b, &b); a=1-t; b=1-u;
    for(w=0;w<3;++w)
      scr[x*mlx+y*mly+w+ofs]=
      (char)(sct[w+z]*a*b+sct[w+z+3]*t*b+sct[w+z+480]*a*u+sct[w+z+483]*t*u);
  }
  if((f=fopen("C:\\WallGen.bmp", "wb"))!=0) {
    fwrite(scr, mly*scy+ofs, 1, f);
    fclose(f);
    SystemParametersInfo(20, 0, "C:\\WallGen.bmp", 3);
  }
  free(scr);
  return(0);
}

void dodot(int x, int y, unsigned char *p, unsigned char *q, unsigned char *r)
{
 int z;
 double a, b, c, s, t;
  a=b=c=t=0;
  for(z=0;z<pts;++z) {
    s=((x-px[z])*(x-px[z]))+((y-py[z])*(y-py[z]));
    a+=pca[z]/s; b+=pcb[z]/s; c+=pcc[z]/s; t+=1./s;
  } a/=t; b/=t; c/=t;
  if((s=a*a+b*b+c*c)<1.)
    a=b=c=rand()%129-64;
  else {
    s=sqrt(s)/64.; if((s<.9&&s>.8)||(s<.7&&s>.6)||(s<.5&&s>.4)||(s<.3&&s>.2)||(s<.1&&s>.0)) s=-s; a/=s; b/=s; c/=s;
  }
  *p=(char)(cca+a);
  *q=(char)(ccb+b);
  *r=(char)(ccc+c);
}
__________________
Structural Integrity for Creator - since he'll probably make PA turn 3D.
Wikipedia forum
Note to self - Don't write Chinese letters with bold and italics...
<!--Last incarnation: Nov 2000-->
Cyp is offline   Reply With Quote
Reply



Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RANDOM events returned Killerbij Planetarion Suggestions 9 21 Nov 2003 17:40
Random really does solve everything Scouse Planetarion Discussions 63 18 Mar 2003 17:52
On request: Description of r9 random gals Al_zz Planetarion Discussions 7 30 Jan 2003 17:22
Secure erasing of data Ragnarak Hardware and Tech Support 10 18 Jan 2003 16:04
Solution to size of random galaxies. Ants Planetarion Discussions 11 6 Jan 2003 05:45


All times are GMT +1. The time now is 17:59.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018