im trying to remove a color from an image by setting the alpha to 0. Problem is....nothings happening does anyone have any idea why??
my Image Class:
#include "DarkGDK.h"
#include <griffon.h>
class G_pix
{
public:
G_pix(char* filename);
~G_pix();
void delete_color(int R,int G, int B);
void change_color(int R1, int G1, int B1, int R2, int G2, int B2);
void set_trans(int R,int G,int B);
void save_image(char* filename);
private:
char* filename;
static g_list<int> indexes;
int id;
int new_mem();
int dem_mem();
int create_img();
};
//classes
G_pix::G_pix(char *filename)
{
dbLoadImage("myimage.png",1);
id=1;//temp
}
G_pix::~G_pix()
{
}
void G_pix::set_trans(int R,int G, int B)
{
int Red;
int Green;
int Blue;
//sets image color to transparent
dbMakeMemblockFromImage(id,id);
int by;
for(by=13;by<=dbGetMemblockSize(1);by=by+4)
{
Red=dbMemblockDword(1,by+2);
Green=dbMemblockDword(1,by+1);
Blue=dbMemblockDword(1,by);
if(Red==dbMemblockByte(1,by+2)&&Green==dbMemblockDword(1,by+1)&&Blue==dbMemblockDword(1,by))
{
dbWriteMemblockByte(1,by+4,255);
}
}
dbMakeImageFromMemblock(1,1);//temp
}
Your signature has been erased by a mod - please reduce it to 600x120