Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. creatting a transparent text GIF using CXImage

creatting a transparent text GIF using CXImage

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    emmatty
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups