Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: convert image bitmap 8bits ??? wish help me Pin
Saurabh.Garg7-Nov-08 3:03
Saurabh.Garg7-Nov-08 3:03 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Nishad S7-Nov-08 3:19
Nishad S7-Nov-08 3:19 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Saurabh.Garg7-Nov-08 4:26
Saurabh.Garg7-Nov-08 4:26 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Nishad S7-Nov-08 23:06
Nishad S7-Nov-08 23:06 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
aa_zz9-Nov-08 15:37
aa_zz9-Nov-08 15:37 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
aa_zz9-Nov-08 19:48
aa_zz9-Nov-08 19:48 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Nishad S9-Nov-08 20:35
Nishad S9-Nov-08 20:35 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
aa_zz10-Nov-08 14:07
aa_zz10-Nov-08 14:07 
you convert DrawImage_24Bits() to DrawImage_8Bits() for help me ?. wish your help. thanks very much

void DrawImage_24Bits()
{
string cmd = "";
int i = 0, j = 0;
long x= 0, y =0, nbytes = 0, pos = 0, nbyteR =0;
x = m_biWidth*3;// * 2.875;
y = m_biHeight*3;// * 2.875;
nbyteR = (((m_biWidth * m_biBitCount + 31) & ~31) >> 3);
nbytes = (((x * m_biBitCount + 31) & ~31) >> 3);
y = abs(y);

cmd += STAR; cmd += lib;
m_objPrint->PrintPclCommand(cmd.c_str(), UIM, 0);
int zerobit= nbytes - x;
buf = new char[nbyteR * m_biHeight];
int num_read = fread((void*)buf, sizeof(char), (nbyteR * m_biHeight), f_bmp);
m_sizeimage = nbytes * y;

ResizeBuffImage(buf, num_read, x);
pos = m_sizeimage - nbytes;
int Byte = 0;
for (j = 0; j < y; j++)
{
Byte = 0;
m_objPrint->PrintPclCommand(cmd.c_str(), UIW, nbytes);
for ( i = 0; i < x; i++)
{
m_objPrint->Print(bufR[pos + Byte++]);
m_objPrint->Print(bufR[pos + Byte++]);
m_objPrint->Print(bufR[pos + Byte++]);
}

if(zerobit >0)
for(int tt = 0; tt < zerobit ; tt++)
m_objPrint->Print(0);
pos -= nbytes;
}
}
void ResizeBuffImage(const char *buff, long size, long width)
{
long nbyteR = (((m_biWidth * m_biBitCount + 31) & ~31) >> 3);
long count = 0, w = width, j = 0, tempw = 0;
int redubit= size - m_biWidth * m_biHeight;
if (redubit > 0 && redubit % m_biWidth == 0)
redubit /= m_biWidth ;
bufR = new char[m_sizeimage]; //size * 9
for (long i = 0; i < size; i+=3)
//for (long i = 0; i < size; i++)
{
bufR[count++] = buff[i];
bufR[count++] = buff[i+ 1];
bufR[count++] = buff[i+ 2];

bufR[count++] = buff[i];
bufR[count++] = buff[i+ 1];
bufR[count++] = buff[i+ 2];
bufR[count++] = buff[i];
bufR[count++] = buff[i+ 1];
bufR[count++] = buff[i+ 2];

if ((count + redubit) % (w + redubit) == 0)
{
for (int m = 0; m< redubit; m++)
{
bufR[count++] = buff[i+3+m];
i++;
}
//copy width image to three times
//for (int times = 0; times < 2; times++)
for (int times = 0; times < 2; times++)
{
tempw = count;
for ( j = count - (w + redubit) ; j < tempw ; j++ )
{
bufR[count++] = bufR[j];
}
}
}
}
}
}
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Nishad S10-Nov-08 19:29
Nishad S10-Nov-08 19:29 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Chris Losinger7-Nov-08 6:52
professionalChris Losinger7-Nov-08 6:52 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
aa_zz9-Nov-08 15:25
aa_zz9-Nov-08 15:25 
QuestionAdding one day Pin
AlProb6-Nov-08 23:04
AlProb6-Nov-08 23:04 
AnswerRe: Adding one day Pin
CPallini6-Nov-08 23:18
mveCPallini6-Nov-08 23:18 
GeneralRe: Adding one day Pin
AlProb6-Nov-08 23:25
AlProb6-Nov-08 23:25 
GeneralRe: Adding one day Pin
CPallini6-Nov-08 23:33
mveCPallini6-Nov-08 23:33 
QuestionConverting hexadecimal code into RGB Pin
Dhiraj kumar Saini6-Nov-08 22:13
Dhiraj kumar Saini6-Nov-08 22:13 
AnswerRe: Converting hexadecimal code into RGB Pin
CPallini6-Nov-08 22:36
mveCPallini6-Nov-08 22:36 
GeneralRe: Converting hexadecimal code into RGB Pin
Dhiraj kumar Saini6-Nov-08 22:49
Dhiraj kumar Saini6-Nov-08 22:49 
GeneralRe: Converting hexadecimal code into RGB Pin
CPallini6-Nov-08 22:52
mveCPallini6-Nov-08 22:52 
GeneralRe: Converting hexadecimal code into RGB Pin
Dhiraj kumar Saini6-Nov-08 23:34
Dhiraj kumar Saini6-Nov-08 23:34 
QuestionRe: Converting hexadecimal code into RGB Pin
David Crow7-Nov-08 2:45
David Crow7-Nov-08 2:45 
AnswerRe: Converting hexadecimal code into RGB Pin
CPallini7-Nov-08 3:31
mveCPallini7-Nov-08 3:31 
AnswerRe: Converting hexadecimal code into RGB Pin
sashoalm8-Nov-08 0:07
sashoalm8-Nov-08 0:07 
QuestionDraw on view and over their controls [modified] Pin
baerten6-Nov-08 21:53
baerten6-Nov-08 21:53 
AnswerRe: Draw on view and over their controls Pin
Nishad S7-Nov-08 1:48
Nishad S7-Nov-08 1:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.