home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} frmBitmapTest
- Caption = "SDK Bitmap Test"
- ClientHeight = 5664
- ClientLeft = 48
- ClientTop = 336
- ClientWidth = 6120
- OleObjectBlob = "frmBitmapTest.frx":0000
- StartUpPosition = 1 'CenterOwner
- End
- Attribute VB_Name = "frmBitmapTest"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
-
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2001 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
-
- Private Declare Function BitmapToPicture Lib "ViewPict" _
- (ByVal hDIB As Long) As Object
-
- Private Declare Function MetafileToPicture Lib "ViewPict" _
- (ByVal hMeta As Long, ByVal width As Long, ByVal height As Long) As Object
-
- Private Sub btnBitmap_Click()
- Dim obPic As StdPicture
- Dim vwActive As View
- Dim hDC As Long
- Dim hDIB As Long
- Set vwActive = ActiveDrawing.ActiveView
- hDC = vwActive.OpenBitmapDC
- vwActive.Refresh
- hDIB = vwActive.CloseBitmapDC
- Set obPic = BitmapToPicture(hDIB)
- If Not obPic Is Nothing Then
- Image1.Picture = obPic
- End If
- End Sub
-
- Private Sub btnMetafile_Click()
- Dim obPic As StdPicture
- Dim vwActive As View
- Dim hDC As Long
- Dim hMeta As Long
- Dim width, height As Long
- Set vwActive = ActiveDrawing.ActiveView
- hDC = vwActive.OpenMetafileDC
- vwActive.Refresh
- hMeta = vwActive.CloseMetafileDC
- width = Image1.width * 1.3333
- height = Image1.height * 1.3333
- Set obPic = MetafileToPicture(hMeta, width, height)
- If Not obPic Is Nothing Then
- 'For some reason, the metafile picture is there,
- 'But nothing is drawn
- Image1.Picture = obPic
- End If
- End Sub
-
-