creatting a transparent text GIF using CXImage
-
hello friends, We are doing a project in vc++ for image processing .We used your class(CXImage) in our project for converting user typed text into transparent GIF image. We used the following steps for our requirement. Note: Operating System : Win XP Professional , Development Tool : VC++ 6.0. 1)Create a memoryDC 2)Created a compatible bitmap with the dialog 3)selected the bitmap into MemoryDC 4)Draw Text on that DC 5) Created a CXImage object and passed Bitmap handle to CXImage member function called CreateFromHBITMAP 6) We used the function Save() to save that image. But the problem ia that we can insert the Image to Frontpage but the image is not visible. Following code is extracted from our project void CTestCXImageDlg::OnCreateBMP() { CDC memDC; CBitmap bitmap; CBrush brush(RGB(255,255,255)); CFont font; UpdateData(); font.CreateFontIndirect(&logfont); if(memDC.CreateCompatibleDC(GetDC())) { if(bitmap.CreateCompatibleBitmap(GetDC(),200,50)) { memDC.SelectObject(bitmap); memDC.SetBkColor(RGB(255,255,255)); memDC.FillRect(CRect(0,0,200,50),&brush); CRect rect(60,15,200,50); SetTextColor(memDC.m_hDC,RGB(0,255,0)); memDC.SelectObject(&font); memDC.DrawText(m_Text,&rect,DT_END_ELLIPSIS | DT_CENTER ); CxImage img1; img1.CreateFromHBITMAP((HBITMAP)bitmap.m_hObject); img1.Save("c:\\imgtest.gif",1); . . . . eagerly waiting for your response