VB中如何使用SetBitmapDimensionEx?
nicon 2000-03-18 02:13:00 如下代码不能正确设置图象的尺寸,请高手指点,谢谢!
=》---------Source Code----------------------------
'Form中放置一个名为pic的Picture Box
Dim compatDC As Long
Dim l As Long
Dim tPoint As POINTAPI
Dim hbit As Long
Dim lObject As Long
Dim typSize As Size
compatDC = CreateCompatibleDC(pic.hdc)
hbit = CreateCompatibleBitmap(compatDC, 10, 50)
l = SetBitmapDimensionEx(hbit, 10000, 10000, typSize)
l = GetBitmapDimensionEx(hbit, typSize)
lObject = SelectObject(compatDC, hbit)
lObject = SelectObject(compatDC, GetStockObject(WHITE_PEN))
l = MoveToEx(compatDC, 0, 0, tPoint)
l = LineTo(compatDC, 100, 500)
lObject = SelectObject(compatDC, lObject)
l = BitBlt(pic.hdc, 0, 0, 100, 500, compatDC, 0, 0, SRCCOPY)
l = DeleteObject(hbit)
l = DeleteDC(compatDC)
pic.Refresh