Here is a discussion about dbCircle not working. I posted a solution that gives you more functionallity than dbCircle.
http://forum.thegamecreators.com/?m=forum_view&t=193259&b=22
The concept of using memblocks is not too complicated. There are a few things you need to know. When you make a memblock from an image, the first 12 bytes are used for information like size and format, so you will notice the +12 in my position parameter. Also, each pixil of the memblock is 4 bytes which is represented by the *4
Here is a box function:
void AddBoxToMemblock(int M,int Width,int lx,int ly,int sx,int sy,DWORD C,bool FillIn){
int Size=dbGetMemblockSize(M);
if (FillIn){
for (int y=0;y<sy;y++){
for (int x=0;x<sx;x++){
int pos=((y+ly)*Width+x+lx)*4+12;
if ((lx+x<Width)&&(pos<Size)) dbWriteMemblockDword(M,pos,C);
}
}
}
else{//draw outline
int pos;
//draw the top
for (int x=0;x<sx;x++){
pos=((ly+0)*Width+lx+x)*4+12;
if ((lx+x<Width)&&(pos<Size)) dbWriteMemblockDword(M,pos,C);
}
//draw the bottom
for (int x=0;x<sx;x++){
pos=((ly+sy)*Width+lx+x)*4+12;
if ((lx+x<Width)&&(pos<Size)) dbWriteMemblockDword(M,pos,C);
}
//draw left
for (int y=0;y<sy;y++){
pos=((ly+y)*Width+lx)*4+12;
if (pos<Size) dbWriteMemblockDword(M,pos,C);
}
//draw right
for (int y=0;y<sy;y++){
pos=((ly+y)*Width+lx+sx)*4+12;
if ((lx+sx<Width)&&(pos<Size)) dbWriteMemblockDword(M,pos,C);
}
}
}
Both assume you already have a memblock made from an image and the first parameter in both represent the memblock number.
BTW, to make a memblock for an image:
dbMakeImage(ImageNumber,SizeX,SizeY);
dbMakeMemblockFromImage(MB,ImageNumber);
dbDeleteImage(ImageNumber);//*** this MUST be done or the following creation will fail
//*** puts a red circle, diameter=10, in the memblock
PutCircleInMemBlock(MB,dbRGB(255,0,0),SizeX/2,SizeY/2,10,SizeX,false,255,true);
//*** puts a blue box in the memblock
AddBoxToMemblock(MB,SizeX,SizeX/2,SizeY/2,4,5,dbRGB(0,0,255),false);
// the final thing to do is make the image again
dbMakeImageFromMemblock(ImageNumber,MB);
dbDeleteMemblock(MB);
Then just show your image. This assumes you have a valid ImageNumber and MB.
I don't know how much programming experience you have, but I'll help if you don't understand my ramblings.
The fastest code is the code never written.