티스토리 뷰
http://www.codeguru.com/forum/showthread.php?t=344315
Draw the image in a memory device context in which the CBitmap object is selected.
Like in next example:
Much more easier is if you have Bitmap (Bitmap is derived from Image) that has GetHBITMAP method:
Draw the image in a memory device context in which the CBitmap object is selected.
Like in next example:
using namespace Gdiplus;
Image* pImage = Image::FromFile(L"c:\\test.gif");
Status status = pImage->GetLastStatus();
if(Ok == status)
{
CDC dc;
dc.CreateCompatibleDC(NULL);
CBitmap bitmap;
bitmap.CreateCompatibleBitmap(&dc, pImage->GetWidth(), pImage->GetHeight());
CBitmap* pbmpOld = dc.SelectObject(&bitmap);
Graphics graphics(dc.m_hDC);
status = graphics.GetLastStatus();
if(Ok == status)
{
graphics.DrawImage(pImage, 0, 0);
// enjoy of bitmap;
}
dc.SelectObject(pbmpOld);
}
Image* pImage = Image::FromFile(L"c:\\test.gif");
Status status = pImage->GetLastStatus();
if(Ok == status)
{
CDC dc;
dc.CreateCompatibleDC(NULL);
CBitmap bitmap;
bitmap.CreateCompatibleBitmap(&dc, pImage->GetWidth(), pImage->GetHeight());
CBitmap* pbmpOld = dc.SelectObject(&bitmap);
Graphics graphics(dc.m_hDC);
status = graphics.GetLastStatus();
if(Ok == status)
{
graphics.DrawImage(pImage, 0, 0);
// enjoy of bitmap;
}
dc.SelectObject(pbmpOld);
}
Much more easier is if you have Bitmap (Bitmap is derived from Image) that has GetHBITMAP method:
using namespace Gdiplus;
Bitmap* pBitmap = Bitmap::FromFile(L"c:\\test.gif");
Status status = pBitmap->GetLastStatus();
if(Ok == status)
{
HBITMAP hBitmap = NULL;
status = pBitmap->GetHBITMAP(Color(0,0,0), &hBitmap);
if(Ok == status)
{
CBitmap bitmap;
bitmap.Attach(hBitmap);
// enjoy of bitmap;
}
}
Bitmap* pBitmap = Bitmap::FromFile(L"c:\\test.gif");
Status status = pBitmap->GetLastStatus();
if(Ok == status)
{
HBITMAP hBitmap = NULL;
status = pBitmap->GetHBITMAP(Color(0,0,0), &hBitmap);
if(Ok == status)
{
CBitmap bitmap;
bitmap.Attach(hBitmap);
// enjoy of bitmap;
}
}
'Show' 카테고리의 다른 글
VirtualBox Hyper-V VMware Workstation Parallels Host Key (0) | 2014.07.15 |
---|---|
GDI+ GdiPlus & Outline Text (0) | 2010.03.21 |
Microsoft Developer (0) | 2009.03.01 |
Windows Update Catalog & Microsoft Subscription Downloads (0) | 2008.05.16 |
Windows Automation 프로그램들 (0) | 2008.04.08 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- download.com
- Microsoft
- java
- tagREADYSTATE
- autohotkey
- AdSense숨기기
- Sample Code
- iTextSharp
- 애드센스숨기기
- jre
- ScreenHunter
- .net framework
- 애드센스감추기
- registry
- c#
- Phalanger
- Service pack
- windows
- WinAutomation
- 스크린캡쳐
- iText
- Automation
- AdSense감추기
- 유틸리티
- Rollback Rx
- DotNetMagic
- AxWebBrowser
- READYSTATE_COMPLETE
- Regular Expressions
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함