Hi, i decided to look at memblocks as i want to start up dbpro again from a long break doing websites, so i start to look in the documentation for commands to use, and i look around on the forums for tutorials.
However,
When i try loading an image, turning it into a memblock then turning that memblock back into an image and pasting the image, i get a different result (like Chinese whispers lol).
This is my code:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 0 );
dbLoadImage ("image.png", 1);
dbMakeMemblockFromImage (1,1);
dbDeleteImage (1);
int ImageWidth = dbMemblockDword(1,0);
int ImageHeight = dbMemblockDword(1,4);
int Size = dbGetMemblockSize(1);
while ( LoopGDK ( ) )
{
dbPrint(dbStr(ImageWidth));
dbPrint(dbStr(ImageHeight));
dbPrint(dbStr(Size));
dbPrint(dbStr(dbScreenFPS()));
dbMakeImageFromMemblock (1, 1);
dbPasteImage(1,30,30);
dbDeleteImage(1);
dbLoadImage ("image.png", 1);
dbPasteImage(1,130,30);
dbDeleteImage(1);
dbSync ( );
dbCLS();
}
return;
}
The result is:
The image on the right is how it is in the original file, and the image on the left is how it is after it has been saved into a memblock, and for the life of me i cant figure out why its different.
Thanks in advanced.
PS. Its in a loop because i was going to try and edit the pixels realtime.
Smoke me a kipper, ill be back for breakfast.