有人知道GDI+怎么用!

yuanhen 2003-06-19 07:35:59
bcb6下有gdiplus.h,但是不能用,include后编译会出很多的问题!


有人知道吗?
...全文
49 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuanhen 2003-06-22
  • 打赏
  • 举报
回复


有戏,结贴!

Siney 2003-06-20
  • 打赏
  • 举报
回复
some sample code below:

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include <algorithm>
using std::min;
using std::max;

#include "Unit1.h"
#include <gdiplus.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

using namespace Gdiplus;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
GdiplusStartup( &gdiplusToken, &gdiplusStartupInput, NULL );
}
//---------------------------------------------------------------------------
__fastcall TForm1::~TForm1(void)
{
GdiplusShutdown( gdiplusToken );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::PaintBox1Paint(TObject *Sender)
{
Gdiplus::Graphics g( Canvas->Handle );
Pen pen( Gdiplus::Color( 255, 0, 0, 0 ), 3 );
g.DrawLine( &pen, 50, 50, 500, 50 );
g.DrawPie( &pen, 50, 50, 200, 200, 225, 90 );

SolidBrush sbrush( Gdiplus::Color( 128, 255, 0, 0 ) );
LinearGradientBrush gbrush(
Gdiplus::Point( 50, 100 ),
Gdiplus::Point( 250, 200 ),
Gdiplus::Color( 255, 255, 0, 0 ),
Gdiplus::Color( 128, 0, 0, 0 )
);
g.FillRectangle( &gbrush, 50, 100, 200, 100 );
}
//---------------------------------------------------------------------------
Siney 2003-06-20
  • 打赏
  • 举报
回复
to yuanhen(Thinkpad T40)
you can download .dll lib from ms web.(serach gdiplus)
Siney 2003-06-20
  • 打赏
  • 举报
回复
If you start a new project, make sure you have defined the symbol STRICT
globally. In order to define STRICT for all modules of your application,
simply (from the IDE) you have to open the window Projects->Options, then
choose Directory/Conditional tab. Now, you have to add STRICT in "Conditional
defines" inside the "Conditional" group box. If you are debugging your
application (i.e. you are compiling for debug), probably you have to add a
semicolon after the existent symbol _DEBUG before add the symbol STRICT (i.e.
you should read something like this: _DEBUG;STRICT). Also, remember you have
to include <algorithm>, using std::min and using std::max *before* including
<gdiplus.h>:

...
...
#include <algorithm>
using std::min;
using std::max;
...
...
#include <gdiplus.h>

Remeber also you have to add the library you have created with implib, into
your project.
yuanhen 2003-06-20
  • 打赏
  • 举报
回复


最近人气不行啊!
yuanhen 2003-06-20
  • 打赏
  • 举报
回复


没找到gdiplus.dll. 怎么用!
Siney 2003-06-19
  • 打赏
  • 举报
回复
you can download some component of gdiplus to below url:
http://www.torry.net/
ThinkX 2003-06-19
  • 打赏
  • 举报
回复
以前有帖子说明这个问题,
用implib生成lib然后使用
yuanhen 2003-06-19
  • 打赏
  • 举报
回复


自己UP一下

yuanhen 2003-06-19
  • 打赏
  • 举报
回复


我就是想知道bcb里怎么用,虽然有gdiplus这个头文件但是没法用!

pp616 2003-06-19
  • 打赏
  • 举报
回复
用c#时用过的。bcb里没用过。

1,221

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧