Click here to Skip to main content
15,920,708 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unicode Conversion Pin
Michael Dunn23-Nov-06 0:30
sitebuilderMichael Dunn23-Nov-06 0:30 
GeneralRe: Unicode Conversion Pin
ThatsAlok23-Nov-06 0:46
ThatsAlok23-Nov-06 0:46 
GeneralRe: Unicode Conversion Pin
Michael Dunn23-Nov-06 1:06
sitebuilderMichael Dunn23-Nov-06 1:06 
AnswerRe: Unicode Conversion Pin
Michael Dunn23-Nov-06 0:30
sitebuilderMichael Dunn23-Nov-06 0:30 
GeneralRe: Unicode Conversion Pin
Vineet Kumar23-Nov-06 21:46
Vineet Kumar23-Nov-06 21:46 
GeneralRe: Unicode Conversion Pin
Michael Dunn24-Nov-06 10:35
sitebuilderMichael Dunn24-Nov-06 10:35 
QuestionHow to modify the registry setting? Pin
LaHaHa22-Nov-06 19:44
LaHaHa22-Nov-06 19:44 
AnswerRe: How to modify the registry setting? Pin
Waldermort22-Nov-06 19:54
Waldermort22-Nov-06 19:54 
AnswerRe: How to modify the registry setting? Pin
Suresh H22-Nov-06 19:57
Suresh H22-Nov-06 19:57 
GeneralRe: How to modify the registry setting? Pin
Rajesh R Subramanian22-Nov-06 20:23
professionalRajesh R Subramanian22-Nov-06 20:23 
GeneralRe: How to modify the registry setting? Pin
Suresh H22-Nov-06 20:26
Suresh H22-Nov-06 20:26 
GeneralRe: How to modify the registry setting? Pin
ThatsAlok22-Nov-06 21:35
ThatsAlok22-Nov-06 21:35 
GeneralRe: How to modify the registry setting? Pin
Rajesh R Subramanian22-Nov-06 22:46
professionalRajesh R Subramanian22-Nov-06 22:46 
GeneralRe: How to modify the registry setting? Pin
LaHaHa22-Nov-06 20:24
LaHaHa22-Nov-06 20:24 
GeneralRe: How to modify the registry setting? Pin
ThatsAlok22-Nov-06 21:33
ThatsAlok22-Nov-06 21:33 
AnswerRe: How to modify the registry setting? Pin
Rajesh R Subramanian22-Nov-06 20:19
professionalRajesh R Subramanian22-Nov-06 20:19 
GeneralRe: How to modify the registry setting? Pin
LaHaHa22-Nov-06 20:26
LaHaHa22-Nov-06 20:26 
QuestionHow to use LoadResString in VC++ to load string table Pin
Atul2322-Nov-06 19:39
Atul2322-Nov-06 19:39 
AnswerRe: How to use LoadResString in VC++ to load string table Pin
Rajesh R Subramanian22-Nov-06 20:25
professionalRajesh R Subramanian22-Nov-06 20:25 
QuestionShared Memory and XML File ? [modified] Pin
Sakthiu22-Nov-06 18:47
Sakthiu22-Nov-06 18:47 
AnswerRe: Shared Memory and XML File ? Pin
Viorel.22-Nov-06 20:16
Viorel.22-Nov-06 20:16 
QuestionRotating image Pin
Kshitij Pande22-Nov-06 18:37
Kshitij Pande22-Nov-06 18:37 
AnswerRe: Rotating image Pin
Waldermort22-Nov-06 19:59
Waldermort22-Nov-06 19:59 
GeneralRe: Rotating image Pin
Kshitij Pande22-Nov-06 21:25
Kshitij Pande22-Nov-06 21:25 
GeneralRe: Rotating image Pin
Kshitij Pande23-Nov-06 4:27
Kshitij Pande23-Nov-06 4:27 
Thanks for reply!!!!!!!!!!!
I used this code please tell me any correction....


//This is for getting data from clipboard in CBitmap's object.
OpenClipboard();
Glb=EnumClipboardFormats(0);
HANDLE hBitMap = GetClipboardData(Glb); //getting from clipboard

if(hBitMap == NULL)
{
AfxMessageBox("Error in Capturing Image");
return;
}
//CBitmap * bmp = CBitmap::FromHandle(hBitMap);


CBitmap bmp;


if(!bmp.Attach((HBITMAP)hBitMap))
{
AfxMessageBox( "Error in Loading Image" );

}

BITMAP bitmap ;
bmp.GetBitmap(&bitmap);

int size = ((bitmap.bmWidth)*(bitmap.bmHeight)*(bitmap.bmBitsPixel))/8;
BYTE *lpBits = new BYTE[size];

::GetBitmapBits((HBITMAP)hBitMap,size,lpBits);


WriteBmp("C\\Patient.bmp",&bitmap,(int*)lpBits);

CloseClipboard();



}



For writing ang saving .bmp file.......


void WriteBmp(char* name,BITMAP *bmp,int* data)
{
BITMAPINFO Bmi;
memset(&Bmi,0,sizeof(BITMAPINFO));
Bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Bmi.bmiHeader.biWidth = (bmp->bmWidth);
Bmi.bmiHeader.biHeight = (bmp->bmHeight);
Bmi.bmiHeader.biPlanes = 1;
Bmi.bmiHeader.biBitCount = bmp->bmBitsPixel;
Bmi.bmiHeader.biCompression = BI_RGB;
Bmi.bmiHeader.biSizeImage = bmp->bmHeight*bmp->bmWidth*bmp->bmBitsPixel/8;

FILE* image = fopen (name,"wb");
if(image==0)
return;
int h = abs(Bmi.bmiHeader.biHeight);
int w = abs(Bmi.bmiHeader.biWidth);

Bmi.bmiHeader.biHeight=h;
Bmi.bmiHeader.biWidth=w;


int sz = Bmi.bmiHeader.biSizeImage;

BITMAPFILEHEADER bfh;
bfh.bfType=('M'<<8)+('B');

bfh.bfOffBits=sizeof(BITMAPFILEHEADER)+ sizeof(BITMAPINFOHEADER);
bfh.bfSize=sz+bfh.bfOffBits;
bfh.bfReserved1=0;
bfh.bfReserved2=0;

fwrite(&bfh,sizeof(bfh),1,image);
fwrite(&Bmi.bmiHeader,sizeof(BITMAPINFOHEADER),1,image);
fwrite(data,sz,1,image);
fclose(image);
}
Smile | :)

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.