2011-12-17 2:22:05 阅读20 评论0 172011/12 Dec17
方法1.先从最简单的开始,用picture 控件来实现.
步骤:
先在资源里Import一张图片,ID为IDB_BITMAP2
然后在对话框上添加一个picture控件,右键点击打开属性,
将type下拉框选择BITMAP,紧跟着下面就出现一个Image下拉框,
拉开就会看到所有已经载入好的图片,
选择你要的图片.运行程序即可看到.
方法2 vc picture控件通过CBitmap,HBITMAP,直接用OnPaint()绘制
首先在CTestDlg类中声明一个变量: CBitmap m_bmp;
然后我们在对话框中加入一个picture 标签,名为IDC_STATIC1
然后:
BOOL CDisplayPic::OnInitDialog()
2011-12-17 1:16:45 阅读0 评论0 172011/12 Dec17
方法一:
在OnPaint事件
if (IsIconic())
{
}
else
{
//CDialog::OnPaint();//注意要禁止这个调用
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap bmpBackground;
2009-12-5 14:01:47 阅读22 评论0 52009/12 Dec5
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (LpBrowseInfo As BROWSEINFO) As Long
Private Declare Function SHGetPathFromIDlist Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Const BIF_RETURNONLYFSDIRS = &H1
Private Type BROWSEINFO
hOwner As Long
pidlroot As Long
2009-12-2 23:50:15 阅读81 评论0 22009/12 Dec2
Option Explicit
Private Declare Function FindFirstUrlCacheGroup Lib "wininet.dll" ( _
ByVal dwFlags As Long, _
ByVal dwFilter As Long, _
ByRef lpSearchCondition As Long, _
ByVal dwSearchCondition As Long, _
ByRef lpGroupId As Date, _
ByRef lpReserved As Long) As Long
2009-9-8 12:28:55 阅读585 评论0 82009/09 Sept8
Private Declare Function TransparentBlt Lib "msimg32.dll" _
(ByVal hdcDest As Long, _
ByVal nXOriginDest As Long, _
ByVal nYOriginDest As Long, _
ByVal nWidthDest As Long, _
ByVal nHeightDest As Long, _
ByVal hdcSrc As Long, _
2009-8-13 10:07:05 阅读25 评论0 132009/08 Aug13
2009-8-11 13:23:29 阅读59 评论0 112009/08 Aug11
Option Explicit
Private Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, _
lpPoint As POINTAPI, ByVal hdcSrc As Long, ByVal nXSrc As Long, _
ByVal nYSrc As Long, ByVal nWidth As Long, ByVal nHeight As Long, _
ByVal hbmMask As Long, ByVal xMask As Long, ByVal yMask As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Const pi = 3.14159265358979
2009-7-6 19:33:25 阅读31 评论0 62009/07 July6
Private Function MIM(Arr As Variant) '升序排列
Dim i, j As Long
Dim a As Variant, b As Variant
For i = 0 To UBound(Arr)
For j = i + 1 To UBound(Arr)
a = Arr(i)
b = Arr(j)
If Arr(i) > Arr(j) Then
Arr(i) = b
2009-7-4 16:25:13 阅读17 评论0 42009/07 July4
2009-7-4 4:36:59 阅读30 评论0 42009/07 July4
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const theScreen = 0
Const theForm = 1
Private Sub Command1_Click()
Call keybd_event(vbKeySnapshot, theForm, 0, 0)
'若theForm改成theScreen则Copy整个Screen
DoEvents
SavePicture