Gupta.narod.ru - примеры программирования на Gupta Team Developer 2005 (GTD, CTD, TOM, Quest, SQLTalk, Report Builder, SQLWindows, SQLBase, Oracle, Web Developer, Team Object Manager)

Найти: на
Скачать пример в архиве SalPic
Вернуться на страницу архива примеров

.head 0 +  Application Description: Centura SQLWindows/32 Standard Application Template
.head 1 -  Outline Version - 4.0.27
.head 1 +  Design-time Settings
.data VIEWINFO
0000: 6F00000001000000 FFFF01000D004347 5458566965775374 6174650400010000
0020: 0000000000DF0000 002C000000020000 0003000000FFFFFF FFFFFFFFFFFCFFFF
0040: FFE9FFFFFFFFFFFF FF000000007C0200 004D010000010000 0001000000010000
0060: 000F4170706C6963 6174696F6E497465 6D00000000
.enddata
.head 2 -  Outline Window State: Normal
.head 2 +  Outline Window Location and Size
.data VIEWINFO
0000: 6600040003002D00 0000000000000000 0000B71E5D0E0500 1D00FFFF4D61696E
0020: 0000000000000000 0000000000000000 0000003B00010000 00000000000000E9
0040: 1E800A00008600FF FF496E7465726E61 6C2046756E637469 6F6E730000000000
0060: 0000000000000000 0000000000003200 0100000000000000 0000E91E800A0000
0080: DF00FFFF56617269 61626C6573000000 0000000000000000 0000000000000000
00A0: 3000010000000000 00000000F51E100D 0000F400FFFF436C 6173736573000000
00C0: 0000000000000000 0000000000000000
.enddata
.data VIEWSIZE
0000: D000
.enddata
.head 3 -  Left: -0.013"
.head 3 -  Top:    0.0"
.head 3 -  Width:  8.013"
.head 3 -  Height: 4.969"
.head 2 +  Options Box Location
.data VIEWINFO
0000: D4180909B80B1A00
.enddata
.data VIEWSIZE
0000: 0800
.enddata
.head 3 -  Visible? No
.head 3 -  Left: 4.15"
.head 3 -  Top:    1.885"
.head 3 -  Width:  3.8"
.head 3 -  Height: 2.073"
.head 2 +  Class Editor Location
.head 3 -  Visible? No
.head 3 -  Left: 0.575"
.head 3 -  Top:    0.094"
.head 3 -  Width:  5.063"
.head 3 -  Height: 2.719"
.head 2 +  Tool Palette Location
.head 3 -  Visible? No
.head 3 -  Left: 6.388"
.head 3 -  Top:    0.729"
.head 2 -  Fully Qualified External References? Yes
.head 2 -  Reject Multiple Window Instances? No
.head 2 -  Enable Runtime Checks Of External References? Yes
.head 2 -  Use Release 4.0 Scope Rules? No
.head 1 -  Libraries
.head 1 +  Global Declarations
.head 2 +  Window Defaults
.head 3 +  Tool Bar
.head 4 -  Display Style? Etched
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Form Window
.head 4 -  Display Style? Etched
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Dialog Box
.head 4 -  Display Style? Etched
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Top Level Table Window
.head 4 -  Font Name: MS Sans Serif
.head 4 -  Font Size: 8
.head 4 -  Font Enhancement: System Default
.head 4 -  Text Color: System Default
.head 4 -  Background Color: System Default
.head 3 +  Data Field
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Multiline Field
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Spin Field
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Background Text
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Pushbutton
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 3 +  Radio Button
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Check Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Option Button
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 3 +  Group Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Child Table Window
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  List Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Combo Box
.head 4 -  Font Name: Use Parent
.head 4 -  Font Size: Use Parent
.head 4 -  Font Enhancement: Use Parent
.head 4 -  Text Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 3 +  Line
.head 4 -  Line Color: Use Parent
.head 3 +  Frame
.head 4 -  Border Color: Use Parent
.head 4 -  Background Color: 3D Face Color
.head 3 +  Picture
.head 4 -  Border Color: Use Parent
.head 4 -  Background Color: Use Parent
.head 2 +  Formats
.head 3 -  Number: 0'%'
.head 3 -  Number: #0
.head 3 -  Number: ###000
.head 3 -  Number: ###000;'($'###000')'
.head 3 -  Date/Time: hh:mm:ss AMPM
.head 3 -  Date/Time: M/d/yy
.head 3 -  Date/Time: MM-dd-yy
.head 3 -  Date/Time: dd-MMM-yyyy
.head 3 -  Date/Time: MMM d, yyyy
.head 3 -  Date/Time: MMM d, yyyy hh:mm AMPM
.head 3 -  Date/Time: MMMM d, yyyy hh:mm AMPM
.head 2 -  External Functions
.head 2 +  Constants
.data CCDATA
0000: 3000000000000000 0000000000000000 00000000
.enddata
.data CCSIZE
0000: 1400
.enddata
.head 3 -  System
.head 3 -  User
.head 2 -  Resources
.head 2 -  Variables
.head 2 +  Internal Functions
.head 3 +  Function: SalPicButtonSetFromFile
.head 4 -  Description: author: 	??? adapted by tl
date:	2000
version:	1.00

Lдdt ein Bild (Icon oder Bitmap) auf einen Button.
(ACHTUNG: Geht bei Centura nur wenn kein Bild dem Button zugewiesen ist)
Als Positionen lassen sich die Windows -Buttonstyles benutzen.


Parameter:
phWndControl:	Handle des Buttons
psImage:		Pfad zum Bild
pnType:		PIC_FormatBitmap oder PIC_FormatIcon
pnPosition:	BS_LEFT, BS_CENTER, BS_RIGHT, BS_TOP, BS_BOTTOM

Bsp:
Call SalPicButtonSetFromFile(hWndItem, 'C:\\Test.bmp', PIC_FormatBitmap, BS_LEFT | BS_TOP )

.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndControl
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: psImage
.head 5 -  Number: pnType
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnPosition
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: lhBitmap
.head 5 -  Number: pnStyle
.head 4 +  Actions
.head 5 -  ! Bitmap setzen
.head 5 +  Select Case pnType
.head 6 +  Case PIC_FormatBitmap
.head 7 -  Set pnType = IMAGE_BITMAP
.head 7 -  Set pnStyle = BS_BITMAP
.head 7 -  Break
.head 6 +  Case PIC_FormatIcon
.head 7 -  Set pnType = IMAGE_ICON
.head 7 -  Set pnStyle = BS_ICON
.head 7 -  Break
.head 5 -  ! laden
.head 5 -  Set lhBitmap = LoadImageA( 0, psImage, pnType, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE )
.head 5 -  ! auf Button
.head 5 -  Call SetWindowLongA(phWndControl,GWL_STYLE, pnStyle | GetWindowLongA(phWndControl,GWL_STYLE))
.head 5 -  Call SalSendMsg( phWndControl, BM_SETIMAGE, pnType, lhBitmap )
.head 5 -  !
.head 5 -  ! Positionbits lцschen
.head 5 -  Call SetWindowLongA(phWndControl,GWL_STYLE, (0xFFFFFFFF - (BS_LEFT | BS_CENTER | BS_TOP | BS_BOTTOM | BS_RIGHT)) & GetWindowLongA(phWndControl,GWL_STYLE))
.head 5 -  ! Positionbits setzen
.head 5 -  Call SetWindowLongA(phWndControl,GWL_STYLE, pnPosition | GetWindowLongA(phWndControl,GWL_STYLE))
.head 3 +  Function: SalPicConcatHandle
.head 4 -  Description: author:	Catalin
date:		???
version		1.00 function implemented

desc:
Concatenates to bitmaps (HBITMAP handle) together

example:
Set nPicConcatHandle = SalPicConcatHandle( nPic1,16,16, nPic2,16,16, 8,8 )

.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 -  Number: phImageSource1
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnSource1Width
.head 5 -  Number: pnSource1Height
.head 5 -  !
.head 5 -  Number: phImageSource2
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnSource2Width
.head 5 -  Number: pnSource2Height
.head 5 -  !
.head 5 -  Number: pnTargetX
.head 5 -  Number: pnTargetY
.head 5 -  !
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: hImageTarget
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hDC
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hMemDC1
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hMemDC2
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hMemDC3
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nTargetWidth
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nTargetHeight
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  !
.head 5 -  Set hDC = GetDC( hWndForm )
.head 5 -  Set nTargetWidth = pnTargetX + pnSource2Width
.head 5 -  Set nTargetHeight = pnTargetY + pnSource2Height
.head 5 -  Set hImageTarget =  CreateCompatibleBitmap( hDC, nTargetWidth, nTargetHeight)
.head 5 -  !
.head 5 -  Set hMemDC1 = CreateCompatibleDC( hDC )
.head 5 -  Set hMemDC2 = CreateCompatibleDC( hDC )
.head 5 -  Set hMemDC3 = CreateCompatibleDC( hDC )
.head 5 -  !
.head 5 -  Call SelectObject( hMemDC1, phImageSource1 )
.head 5 -  Call SelectObject( hMemDC2, phImageSource2 )
.head 5 -  Call SelectObject( hMemDC3, hImageTarget )
.head 5 -  !
.head 5 -  Call BitBlt( hMemDC3, 0, 0, pnSource1Width, pnSource1Height , hMemDC1, 0, 0, SRCCOPY )
.head 5 -  Call BitBlt( hMemDC3, pnTargetX, pnTargetY, pnSource2Width, pnSource2Height , hMemDC2, 0, 0, SRCCOPY )
.head 5 -  Call BitBlt( hDC, 0, 0, nTargetWidth, nTargetHeight , hMemDC3, 0, 0, SRCCOPY )
.head 5 -  !
.head 5 -  Call DeleteDC(hMemDC1)
.head 5 -  Call DeleteDC(hMemDC2)
.head 5 -  Call DeleteDC(hMemDC3)
.head 5 -  Call ReleaseDC(hWndForm,hDC)
.head 5 -  !
.head 5 -  Return hImageTarget
.head 3 +  Function: SalPicLoadHandle
.head 4 -  Description: author:	tl
date:		20.7.2002
version		1.00 function implemented

desc:
Loads a picture ressource and returns the Windows HBITMAP handle

example:
Set nPicHandle = SalPicLoadHandle('bmpTest')
.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 -  String: fpsRessourceName
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Long String: strBuffer
.head 4 +  Actions
.head 5 -  Set strBuffer = SalRessourceLoad( fpsRessourceName )
.head 5 -  Return SalPicStringToHandle( strBuffer )
.head 3 +  Function: SalPicLoadFromDLL
.head 4 -  Description: author: 	???
date:	???
version:	???

desc:
Loads a icon from a DLL and returns the HIcon windows handle. The picture number is the ressourcenumber, starting at 1

example:
Set lnPic = SalPicLoadFromDLL('shell32.dll', 1)
Call SalPicSetHandle( pic1, PIC_FormatIcon, lnPic)

.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 -  String: psDLLName
.data INHERITPROPS
0000: 0100
.enddata
.head 5 +  Number: pnPicNumber
.data INHERITPROPS
0000: 0100
.enddata
.head 6 -  ! the ressourcenumber of the picture
.head 4 -  Static Variables
.head 4 -  Local variables
.head 4 +  Actions
.head 5 -  Return LoadIconA( GetModuleHandleA( psDLLName ), pnPicNumber )
.head 3 +  Function: SalPicSetFileX
.head 4 -  Description: author:	CTD Position
date:		???
version		1.00 function implemented

desc:
Inserts a file's contents into a picture.
Supports more formats and better quality than SalPicSetFile().
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: hWndPic
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: psFile
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: hImg
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hDC
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: hBitmap
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Set hImg = ImgOpenSolo( psFile, NUMBER_Null )
.head 5 -  Set hDC  = GetDC( hWndPic )
.head 5 -  Set hBitmap = ImgGetDDB( hImg, hDC )
.head 5 -  Call SalPicSetHandle( hWndPic , PIC_FormatBitmap, hBitmap )
.head 5 -  Call ReleaseDC( hWndPic, hDC )
.head 5 -  Return TRUE
.head 3 +  Function: SalPicSetX
.head 4 -  Description: author:	Silvester van Ent
date:		11.6.2002
version		1.00 function implemented

desc:
Works like SalPicSet, but the ressource can be specified in a string.

example:
Call SalPicSetX( pic1, 'bmpText', PIC_FormatBitmap )
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndPic
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: psRessourceName
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: pnFormatType
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: lvnDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  String: lvsDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Date/Time: lvdDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Window Handle: lvwDummy
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 -  Call SalCompileAndEvaluate ( ' SalPicSet( phWndPic, ' || psRessourceName || ', pnFormatType ) ', lvnDummy, lvnDummy, lvnDummy, lvsDummy, lvdDummy, lvwDummy, FALSE, SalContextCurrent(  ) )
.head 3 +  Function: SalPicStringToHandle
.head 4 -  Description: author:	some code from newsgroup + tl
date:		20.7.2002
version		1.00 function implemented

desc:
Converts a stringbuffer to the Windows HBITMAP handle

example:
Set nPicHandle = SalPicStringToHandle(strBuffer)
.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 -  Long String: strBuffer
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: nBufferLength
.head 5 -  Number: nBuffer
.head 5 -  Number: hImage
.head 5 -  Number: hDC
.head 5 -  Number: hBitmap
.head 5 -  Number: lvnDummy
.head 5 -  String: lvsDummy
.head 5 -  Date/Time: lvdDummy
.head 5 -  Window Handle: lvwDummy
.head 4 +  Actions
.head 5 -  !
.head 5 -  Set nBufferLength = SalStrGetBufferLength (strBuffer)
.head 5 -  Set nBuffer = SWinStringGetBuffer (strBuffer, nBufferLength)
.head 5 +  Set hImage =  ImgOpenMem (nBuffer, nBufferLength, STRING_Null)
.head 6 -  ! ! ImgOpenMem is exported from imageman library
.head 5 -  !
.head 5 -  Set hDC = GetDC (hWndForm)
.head 5 +  If ( NOT hDC )
.head 6 -  Return NUMBER_Null
.head 5 -  ! now get the device dependent bitmap handle
.head 5 -  Set hBitmap	= ImgGetDDB( hImage, hDC )
.head 5 -  ! release device contexts
.head 5 -  Call ReleaseDC (hWndForm, hDC)
.head 5 -  Return hBitmap
.head 3 +  Function: SalPicFromClipboard
.head 4 -  Description: author:	 taken from NG (Joakim N)
date:	2.07 2003
version:	1.00

desc:
Copies the content of  the clipboard to a picture

example:
Call SalPicFromClipboard( pic1 )
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndPic
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Boolean: bOK
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nHandle
.data INHERITPROPS
0000: 0100
.enddata
.head 4 +  Actions
.head 5 +  If OpenClipboard(hWndNULL)
.head 6 -  Set nHandle = GetClipboardData(CF_BITMAP)
.head 6 -  Set bOK = SalPicSetHandle (phWndPic, PIC_FormatBitmap, nHandle)
.head 6 -  Call CloseClipboard()
.head 5 -  Return bOK
.head 3 +  Function: SalPicToClipboard
.head 4 -  Description: author:	James McCall (taken out of ImageManInterface.apl)
date:	8.05 2002
version:	1.00

desc:
Copies the content of a picture to the clipboard

example:
Call SalPicToClipboard( pic1 )
.head 4 -  Returns
.head 4 +  Parameters
.head 5 -  Window Handle: phWndPic
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: nLeft
.head 5 -  Number: nTop
.head 5 -  Number: nRight
.head 5 -  Number: nBottom
.head 5 -  Number: hDC
.head 5 -  Number: hDC2
.head 5 -  Number: hBitmap
.head 5 -  Number: hBitmapOld
.head 4 +  Actions
.head 5 -  Call GetWindowRect( phWndPic, nLeft, nTop, nRight, nBottom )
.head 5 -  !
.head 5 -  Set hDC		= GetDC( phWndPic )
.head 5 -  Set hDC2		= CreateCompatibleDC( hDC )
.head 5 -  Set hBitmap	= CreateCompatibleBitmap( hDC, nRight - nLeft, nBottom - nTop )
.head 5 -  Set hBitmapOld	= SelectObject( hDC2, hBitmap )
.head 5 -  !
.head 5 -  Call BitBlt( hDC2, 0, 0, nRight - nLeft, nBottom - nTop, hDC, 0, 0, SRCCOPY )
.head 5 -  !
.head 5 -  Call OpenClipboard( hWndForm )
.head 5 -  Call EmptyClipboard( )
.head 5 -  Call SetClipboardData( CF_BITMAP, hBitmap )
.head 5 -  Call CloseClipboard( )
.head 5 -  !
.head 5 -  Call ReleaseDC( phWndPic, hDC )		! call ReleaseDC( ) for device contexts opened with GetDC( )
.head 5 -  Call SelectObject( hDC2, hBitmapOld )
.head 5 -  Call DeleteDC( hDC2 )			! call DeleteDC( ) for device contexts opened with CreateCompatibleDC( )
.head 3 +  Function: SalPicHandleReplaceColor
.head 4 -  Description:
.head 4 +  Returns
.head 5 -  Number:
.head 4 +  Parameters
.head 5 -  Number: hBitmapToCopy
.head 5 -  Number: nType
.head 5 -  Number: nColorOld
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Number: nColorRelpace
.data INHERITPROPS
0000: 0100
.enddata
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: nHeightImage
.head 5 -  Number: nWidthImage
.head 5 -  Number: hBitmapReturn
.head 5 -  Number: hBitmapOld
.head 5 -  Number: hBitmapOld2
.head 5 -  Number: hDC
.head 5 -  Number: hDCMem
.head 5 -  Number: hDCMem2
.head 5 -  Number: nX
.head 5 -  Number: nY
.head 5 -  Number: nColor
.head 5 -  Number: nDitherColor
.head 5 -  Number: nAverageColor
.head 5 -  Number: nStep
.head 5 -  Number: nBitmapWidth
.head 5 -  Number: nBitmapHeight
.head 4 +  Actions
.head 5 -  Set hDC = GetDC(hWndNULL)
.head 5 -  Set hDCMem=CreateCompatibleDC(hDC)
.head 5 -  Call SalPicHandleGetSize( hBitmapToCopy, nType, nWidthImage, nHeightImage )
.head 5 +  ! If nType = IMAGE_BITMAP OR nType = PIC_FormatBitmap
.head 6 -  Call GetBitmapSize( hBitmapToCopy, nWidthImage, nHeightImage )
.head 5 +  ! Else If nType = IMAGE_ICON OR nType = PIC_FormatIcon
.head 6 -  Call GetIconSize( hBitmapToCopy, nWidthImage, nHeightImage )
.head 5 -  !
.head 5 -  Call SetBkColor( hDCMem, SalColorFromRGB( 255, 0, 255 ) )
.head 5 -  Call SetTextColor( hDCMem, SalColorFromRGB( 255, 0, 255 ) )
.head 5 -  Call PatBlt( hDCMem, 0, 0, nWidthImage, nHeightImage, WHITENESS )
.head 5 -  Set hBitmapOld = SelectObject(hDCMem, hBitmapToCopy)
.head 5 -  Set nDitherColor = GetSysColor(COLOR_GRAYTEXT)
.head 5 -  Set nX = 0
.head 5 +  While nX <= nWidthImage
.head 6 -  Set nY = 0
.head 6 +  While nY <= nHeightImage
.head 7 -  Set nColor = GetPixel(hDCMem, nX, nY)
.head 7 +  If nColor = nColorOld
.head 8 -  Set nColor = nColorRelpace
.head 7 -  Call SetPixelV(hDCMem, nX, nY, nColor )
.head 7 -  Set nY = nY + 1
.head 6 -  Set nX = nX + 1
.head 5 -  Call SelectObject(hDCMem,hBitmapOld)
.head 5 -  Call DeleteDC( hDCMem )
.head 5 -  Call ReleaseDC( hWndNULL, hDC )
.head 5 -  Return hBitmapToCopy
.head 3 +  Function: SalPicHandleGetSize
.head 4 -  Description:
.head 4 +  Returns
.head 5 -  Boolean:
.head 4 +  Parameters
.head 5 -  Number: hPic
.head 5 -  Number: nType
.data INHERITPROPS
0000: 0100
.enddata
.head 5 -  Receive Number: nWidth
.head 5 -  Receive Number: nHeight
.head 4 -  Static Variables
.head 4 +  Local variables
.head 5 -  Number: nImageInfo
.head 5 -  Number: nFlags
.head 5 -  String: sBitmapBuffer
.head 5 -  Boolean: bIcon
.head 5 -  Number: nXHotspot
.head 5 -  Number: nYHotspot
.head 5 -  Number: hBitmapMask
.head 5 -  Number: hBitmapColor
.head 4 +  Actions
.head 5 +  Select Case nType
.head 6 -  Case IMAGE_BITMAP
.head 6 +  Case PIC_FormatBitmap
.head 7 -  Call SalStrSetBufferLength( sBitmapBuffer, 24 )
.head 7 -  Call GetObjectA( hPic, 24, sBitmapBuffer )
.head 7 -  Set nWidth =  CStructGetInt( sBitmapBuffer, 4 )
.head 7 -  Set nHeight =  CStructGetInt( sBitmapBuffer, 8 )
.head 7 -  Return TRUE
.head 7 -  Break
.head 6 -  Case IMAGE_ICON
.head 6 +  Case PIC_FormatIcon
.head 7 -  Call GetIconInfo( hPic, bIcon, nXHotspot, nYHotspot, hBitmapMask, hBitmapColor )
.head 7 -  Call SalPicHandleGetSize( hBitmapColor, PIC_FormatBitmap, nWidth, nHeight )
.head 7 -  Return TRUE
.head 7 -  Break
.head 2 -  Named Menus
.head 2 -  Class Definitions
.head 2 +  Default Classes
.head 3 -  MDI Window: cBaseMDI
.head 3 -  Form Window:
.head 3 -  Dialog Box:
.head 3 -  Table Window:
.head 3 -  Quest Window:
.head 3 -  Data Field:
.head 3 -  Spin Field:
.head 3 -  Multiline Field:
.head 3 -  Pushbutton:
.head 3 -  Radio Button:
.head 3 -  Option Button:
.head 3 -  Check Box:
.head 3 -  Child Table:
.head 3 -  Quest Child Window: cQuickDatabase
.head 3 -  List Box:
.head 3 -  Combo Box:
.head 3 -  Picture:
.head 3 -  Vertical Scroll Bar:
.head 3 -  Horizontal Scroll Bar:
.head 3 -  Column:
.head 3 -  Background Text:
.head 3 -  Group Box:
.head 3 -  Line:
.head 3 -  Frame:
.head 3 -  Custom Control:
.head 3 -  ActiveX:
.head 2 -  Application Actions


Gupta.narod.ru - примеры программирования на Gupta Team Developer 2005 (GTD, CTD, TOM, Quest, SQLTalk, Report Builder, SQLWindows, SQLBase, Oracle, Web Developer, Team Object Manager)

Google
 

Return to http://gupta.narod.ru/


Сайт создан в системе uCoz