Click here to Skip to main content
15,890,438 members

Comments by Member 14594285 (Top 200 by date)

Member 14594285 23-Apr-24 4:32am View    
thanks very much
Member 14594285 23-Apr-24 4:21am View    
I can't because your answer in in the comments
Member 14594285 22-Apr-24 12:02pm View    
I solved, thanks
Member 14594285 22-Apr-24 11:47am View    
Deleted
I tried this:

void ResizeBitmap (CBitmap &bmp_src, CBitmap& bmp_dst, int dstW, int dstH)
{
BITMAP bm = { 0 };
bmp_src.GetBitmap (&bm);
auto size = CSize (bm.bmWidth, bm.bmHeight);
CWindowDC wndDC(NULL);
CDC srcDC;
srcDC.CreateCompatibleDC(&wndDC);
auto oldSrcBmp = srcDC.SelectObject(&bmp_src);

CDC destDC;
destDC.CreateCompatibleDC(&wndDC);
bmp_dst.CreateCompatibleBitmap (&wndDC, dstW, dstH);
auto oldDestBmp = destDC.SelectObject (&bmp_dst);

destDC.StretchBlt(0, 0, dstW, dstH, &srcDC, 0, 0, size.cx, size.cy, SRCCOPY);
}

but image isn't loaded
Member 14594285 22-Apr-24 9:39am View    
I loaded image:

CBitmap bitmap;

bitmap.Attach(image.Detach());

HBITMAP hBitmap6 = (HBITMAP)bitmap.GetSafeHandle();

m_Btn1.SetBitmap(hBitmap6);

but image isn't proportionate to size of button