Image image(L"F:\\MyPictures\\1.jpg"); TextureBrush tBrush(&image);
Pen texturedPen(&tBrush, 10); graphics.DrawLine(&texturedPen, 25, 25, 325, 25);
tBrush.SetWrapMode(WrapModeTileFlipXY);
graphics.FillRectangle(&tBrush, 25, 100, 300, 200);
如题,运行第一句就出现内存不可读的错误
代码是从网上复制的,其中F:\\MyPictures\\1.jpg为我自己的图片的路径,确实存在
请教高人啊
Pen texturedPen(&tBrush, 10); graphics.DrawLine(&texturedPen, 25, 25, 325, 25);
tBrush.SetWrapMode(WrapModeTileFlipXY);
graphics.FillRectangle(&tBrush, 25, 100, 300, 200);
如题,运行第一句就出现内存不可读的错误
代码是从网上复制的,其中F:\\MyPictures\\1.jpg为我自己的图片的路径,确实存在
请教高人啊
解决方案 »
- 用CreateRoundRectRgn创建的圆角矩形如何抗锯齿?
- 关于msvcrt.dll 的问题?
- ShellExecute不能用
- CHECK COM CODE( ) IDISPATCH ERROR #3092 这是个什么错误?
- VC/MFC硬件/系统类投诉和建议专帖
- 怎样写包?
- 一个调试中的小问题~~~~
- 各位有没有将bmp和jpg图像由彩色转为黑白的程序段?
- 请问一个关于CEdit的问题?谢谢!
- 请推荐下VS 2013 MFC 下可以使list control可编辑的控件
- 以 SYSTEM 运行的进程,无法使用 ::IsWindow() 等函数
- if ( FindWindow(NULL,"1")==0 && FindWindow(NULL,"0")==0) 在这里我该怎样用这句结束呢?
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
我已经画出了一些东西,比如用PathGradientBrush画一个颜色渐变的Pie
但是用到上面代码的时候就出错了...
不知道原因
CPaintDC dc(this);
Graphics graphics(dc.m_hDC);
Pen pen(Color(255,0,0,255));
graphics.DrawLine(&pen,Point(10,10),Point(250,220));
执行以上代码没有任何反应!
PS:GDI+的相应配置都做好了
Image image(L"F:\\MyPictures\\1.jpg");
GdiplusStartupInput gdiplusInput;
GdiplusStartup(&m_gdiplusToken,&gdiplusInput,NULL); CGDIPlusDlgDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
GdiplusShutdown(m_gdiplusToken);
同样的,在MDI程序中,我把那2句代码放到ShowWindow之前就好了,不再报错!
可为什么在MDI程序中,那2句代码放在ShowWindow之后可以画其它图形,单单无法显示Image?