在TImage控件中显示图片时,怎样获得图片的设备上下文hdc 在TImage控件中显示图片时,怎样获得图片的设备上下文hdc,是不是这个属性TImage.Canvas.Handle; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to: mikespook用了这个参数,在调用VC做的动态库时:动态库导出函数中执行到HDC hdcCompatible = CreateCompatibleDC(hdc)时; (hdc是我从delphi传进去的设备上下文),却总是创建失败,我是VC和delphi混合编程,VC做动态库,delphi做应用程序前台界面。 IMAGEDATA_API int WINAPI I_ReqPixData(HBITMAP hbm, HDC hdc){ PBITMAPINFO pbmi; int nWidth; int nHeight; pbmi = CreateBitmapInfoStruct(hbm); nWidth=pbmi->bmiHeader.biWidth; nHeight=pbmi->bmiHeader.biHeight; HDC hdcCompatible = CreateCompatibleDC(hdc); DWORD err; if (hdcCompatible==0) { err=GetLastError(); } /* Select the bitmaps into the compatible DC. */ SelectObject(hdcCompatible, hbm); //ShowWindow(SW_HIDE); BitBlt(hdcCompatible, 0,0, nWidth, nHeight, hdc, 0,0, SRCCOPY); //ShowWindow(SW_SHOW); char* strfile="d:\\wqs1.bmp"; CreateBMPFile(strfile,pbmi,hbm,hdcCompatible); return 0;} 你用Image1.Handle替换一下bitmap的句柄看看~~~~这里的HDC是设备环境句柄~~~不是BITMAP的句柄~~ Delphi 更新带引号的值 这样的表如何设计?这样的输入界面如何设计? 小问题请叫了.不好意思 汉字跟字母快速匹配的函数是什么? 请各位帮忙看看怎么回事? 高手?怎样删除IE历史记录的某一条记录 关于十进制和十六进制的问题???????????????????????????????????????????????? 小问题,怎么将一个变量转换成控件呀!!我忘记了 帮朋友问:在珠海文员好找工作么,待遇怎样,房租和生活费大概怎样?? 请大家看看 to ddqqyy ,eileen2004的邮箱:[email protected] 如何跟踪某个功能所执行的是哪一部门的代码?
用了这个参数,在调用VC做的动态库时:动态库导出函数中执行到HDC hdcCompatible = CreateCompatibleDC(hdc)时; (hdc是我从delphi传进去的设备上下文),却总是创建失败,
我是VC和delphi混合编程,VC做动态库,delphi做应用程序前台界面。
{
PBITMAPINFO pbmi;
int nWidth;
int nHeight;
pbmi = CreateBitmapInfoStruct(hbm);
nWidth=pbmi->bmiHeader.biWidth;
nHeight=pbmi->bmiHeader.biHeight;
HDC hdcCompatible = CreateCompatibleDC(hdc);
DWORD err;
if (hdcCompatible==0)
{
err=GetLastError(); }
/* Select the bitmaps into the compatible DC. */
SelectObject(hdcCompatible, hbm);
//ShowWindow(SW_HIDE);
BitBlt(hdcCompatible,
0,0,
nWidth, nHeight,
hdc,
0,0,
SRCCOPY);
//ShowWindow(SW_SHOW);
char* strfile="d:\\wqs1.bmp";
CreateBMPFile(strfile,pbmi,hbm,hdcCompatible);
return 0;
}