| |
Anzeigen |
|
|
Social Bookmark Script |
|
|
|
 |
Probleme mit ActiveX und Handle |
Roman Köhler
Administrator
    

Dabei seit: 29.08.2007
Beiträge: 202
Einsatzart von VDF: gewerblich Anwenderstatus: VDF-Entwickler Herkunft: Mannheim Betriebssystem: Windows XP
 |
|
| Probleme mit ActiveX und Handle |
 |
Hallo liebe VDF-Entwickler,
ich habe mal wieder ein Problem mit meinem Lieblingsthema: Handles.
Im letzten Drive-Inn wurde mir das Tool GDPicture empfohlen, um Scans aus VDF heraus zu veranlassen. Ich habe mir eine Version heruntergeladen und versuche nun den VB-Quellcode in VDF zu übersetzen.
Hierbei habe ich dann folgendes Problem:
VB-Code: While Imaging1.CreateImageFromTwain(Me.Handle.ToInt32) <> 0
Ich weiß nun aber nicht, wie ich diese Zeile in VDF übersetzen soll, da ich mich mit dem Handle-Parameter absolut nicht auskenne. Wo und wie kann ich den ermitteln?
Bisher habe ich folgendes: Get ComCreateImageFromTwain of oComImaging1
Ich denke, das stellt für Euch kein Problem dar. Deshalb bedanke ich mich schon mal im Voraus und wünsche Euch ein schönes WE.
Euer
Roman
|
|
30.04.2010 10:29 |
|
|
Ralf
Eroberer
  
Dabei seit: 30.03.2008
Beiträge: 60
 |
|
Hallo Roman,
ich habe ein PKG vo Dittmar Stiebitz aus Berlin bekommen. Vielleicht mal dort nachfragen:
pankow@kus-bau.de
Ralf
|
|
03.05.2010 12:58 |
|
|
Roman Köhler
Administrator
    

Dabei seit: 29.08.2007
Beiträge: 202
Einsatzart von VDF: gewerblich Anwenderstatus: VDF-Entwickler Herkunft: Mannheim Betriebssystem: Windows XP
Themenstarter
 |
|
Hallo Ralf,
vielen Dank für Deine Antwort. Ich habe Dittmar angeschrieben (und hoffe auf eine Antwort.) Könntest Du bitte trotzdem so freundlich sein, den Code dieser einen Zeile zu posten? Wäre super.
Danke schon mal.
Dein
Roman
|
|
04.05.2010 08:31 |
|
|
Ditte
Foren As
   

Dabei seit: 23.07.2007
Beiträge: 77
Einsatzart von VDF: gewerblich Anwenderstatus: Programmierprofi Herkunft: Berlin Betriebssystem: XP,Win7,Win Serv2003,2008
 |
|
Hallo,
nach dem importieren stehen 2 Hauptobjekte zur Verfügung:
cComGdViewer --> zum Anzeigen aller Elemente:
TIFF, GIF, JPEG, PNG, WMF, BMP, WBMP, ICO, JBG, PDF, PCX, PNM, JPEG-2000 File, JPEG-2000 codestream, HDR, Photoshop files, TARGA, JNG, EXR, DDS, PPM, SGI, PBM, PGM, PFM, XBM, XPM, KOALA, IFF, Dr. Halo files, RAW Fax G3, JBIG, Kodak PhotoCD files, Sun RAS files, camera RAW and many others.
cComImaging --> zum Bearbeiten, konvertieren etc.
Kleines Beispiel (cComImaging)-->für des zum Lesen von Barcodes aus pdf und tif
| code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
|
//***************************************************************************
//*
//* Class: cKusComGdViewerCnt
//* Package Name: cKusComGdViewerCnt.pkg
//*
//***************************************************************************
Use gdpicturepro5.pkg
Class cKusComImaging is a cComImaging
// Construct_Object: Object constructor.
Procedure Construct_object
Forward Send Construct_Object
// Define new Properties: Property {Type} {pxName} {initial_value}
//
// Create child objects
// Set property values:
End_Procedure
// Create and augment procedure and functions
Procedure OnCreate
boolean lb_ok
Forward Send OnCreate
Get ComSetLicenseNumber1DBarcodeRecognition "XXXXXXXXXXXXXXXXXXXXXX" to lb_ok //Test-Demo Lizenz KUS_Lizenz
end_procedure
Procedure Destroy_Object
Forward Send Destroy_Object // must be sent
End_Procedure
Function KusComCreateImageFromFile String llsFilePath Returns Integer
Integer ireturn
Get ComCreateImageFromFile llsFilePath to ireturn
Function_Return ireturn
End_Function
Function KusComBarcode1DReaderDoScan Integer isScanMode Returns OLEGdPictureStatus
OLEBarcode1DReaderScanMode iscanmode
OLEGdPictureStatus isretval
Move isScanMode to iscanmode
Get ComBarcode1DReaderDoScan iscanmode to isretval
Function_Return isretval
End_Function
//Auswertung
//wie viele Barcodes wurden gefunden
Function KusComBarcode1DReaderGetBarcodeCount Returns Integer
Integer iBarcodes
If (IsComObjectCreated(Self)) Begin
Get ComBarcode1DReaderGetBarcodeCount to iBarcodes
End
Function_Return iBarcodes
End_Function
//
Function KusComBarcode1DReaderGetBarcodeSkewAngle Integer iNrBarcode Returns Number
Number nBarcodeWert
Real rBarcodeWert
If (IsComObjectCreated(Self)) Begin
Get ComBarcode1DReaderGetBarcodeSkewAngle iNrBarcode to rBarcodeWert
Move rBarcodeWert to nBarcodeWert
End
Function_Return nBarcodeWert
End_Function
//Barcodetype
//Barcode1DReaderNone = 0;Barcode1DReaderIndustrial2of5 = 1;Barcode1DReaderCode39 = 32;....Barcode1DReaderCode128 = 4096
Function KusComBarcode1DReaderGetBarcodeType Integer iNrBarcode Returns Integer
OLEBarcode1DReaderType iBarcodeType
Real rBarcodeWert
If (IsComObjectCreated(Self)) Begin
Get ComBarcode1DReaderGetBarcodeType iNrBarcode to iBarcodeType
End
Function_Return iBarcodeType
End_Function
//BarcodeWert
Function KusComBarcode1DReaderGetBarcodeValue Integer iNrBarcode Returns String
String sBarcodeWert
If (IsComObjectCreated(Self)) Begin
Get ComBarcode1DReaderGetBarcodeValue iNrBarcode to sBarcodeWert
End
Function_Return sBarcodeWert
End_Function
//entfernt alle Informationen des letzten Barcodes aus dem Speicher
Procedure KuscomBarcode1DReaderClear
Boolean bIsComObjectCreated
String ls_format
Get IsComObjectCreated(Self) to bIsComObjectCreated
If (bIsComObjectCreated) Begin
Send comBarcode1DReaderClear
End
End_Procedure
//Wasserzeichen
//OLEFontStyleRegular for 0
//OLEFontStyleBold for 1
//OLEFontStyleItalic for 2
//OLEFontStyleBoldItalic for 3
//OLEFontStyleUnderline for 4
//OLEFontStyleStrikeout for 8
Function KusComDrawText String llsText Integer llnDstLeft Integer llnDstTop Integer llnFontSize OLEFontStyle llnFontStyle OLEColors llnTextARGBColor String llsFontName Boolean llbAntiAlias Returns OLEGdPictureStatus
OLEGdPictureStatus iStatus
If (IsComObjectCreated(Self)) Begin
Get ComDrawText llsText llnDstLeft llnDstTop llnFontSize llnFontStyle llnTextARGBColor llsFontName llbAntiAlias to iStatus
End
Function_Return istatus
End_Function
//speichert und schliesst Image
Function KusComCloseNativeImage Returns Integer
OLEGdPictureStatus iStatus
Integer isretval
Boolean bIsComObjectCreated
String ls_format
Get IsComObjectCreated(Self) to bIsComObjectCreated
If (bIsComObjectCreated) Begin
Get ComCloseNativeImage to iStatus
End
Function_Return isretval
End_Function
Function KusComBarCodeDraw39 String scode39 Integer iDstLeft Integer iDstTop Integer iHeight Boolean bAddCheckSum Integer icolor Returns Integer
OLEGdPictureStatus istatus
DWord dw_color
Move icolor to dw_color
If (IsComObjectCreated(Self)) Begin
Get ComBarCodeDraw39 scode39 iDstLeft iDstTop iHeight bAddCheckSum dw_color to istatus
End
Function_Return istatus
End_Function
Function KusComBarCodeDraw128 String scode128 Integer iDstLeft Integer iDstTop Integer iHeight Boolean bAddCheckSum Integer icolor Returns Integer
OLEGdPictureStatus istatus
DWord dw_color
Move icolor to dw_color
If (IsComObjectCreated(Self)) Begin
Get ComBarCodeDraw128 scode128 iDstLeft iDstTop iHeight bAddCheckSum dw_color to istatus
End
Function_Return istatus
End_Function
End_Class // cKusComGdViewerCnt |
|
Im Testcode später:
| code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
|
Object oKusComImaging1 is a cKusComImaging
Set Size to 100 100
Set Location to 7 117
End_Object
Object oKusButton9 is a cKusButton
Set Size to 14 88
Set Location to 16 319
Set Label to "Barcode in Tif"
Procedure OnClick
String spfad
String sBarcodeWert
Number nBarcodePos
Integer iImageId iClonedImageID
Integer i
Integer iStatus
Integer ibarcodesCount
Integer ibarcodeType
Integer iRGBColor
Handle hImageobject
OLEGdPictureStatus iststatus
Forward Send OnClick
Move (oKusComImaging1(Self)) to hImageobject
Get Value of oKusForm8 to spfad
Get KusComCreateImageFromFile of hImageobject spfad to iImageId
Get KUSComBarcode1DReaderDoScan of hImageobject 1 to iststatus
Get KusComBarcode1DReaderGetBarcodeCount of hImageobject to ibarcodesCount
For i from 1 to ibarcodesCount
Get KusComBarcode1DReaderGetBarcodeValue of hImageobject i to sBarcodeWert
Get KusComBarcode1DReaderGetBarcodeType of hImageobject i to ibarcodeType
Get KusComBarcode1DReaderGetBarcodeSkewAngle of hImageobject i to nBarcodePos
Send Info_Box (KusComBarcode1DReaderGetBarcodeValue(hImageobject, i)) "Barcode Wert"
Send Info_Box (KusComBarcode1DReaderGetBarcodeType(hImageobject, i)) "Barcode Typ"
Send Info_Box (KusComBarcode1DReaderGetBarcodeSkewAngle(hImageobject, i)) "Barcode Typ"
Loop
Send KusComBarcode1DReaderClear of hImageobject
//Barcode eintragen
//Get ComGetNativeImage of oGdViewer to li_obj
Get ComCreateClonedImage of hImageobject iImageId to iClonedImageID
Send ComSetNativeImage of hImageobject iClonedImageID
Move -1778384896 to iRGBColor
Get KusComBarCodeDraw39 of hImageobject "*B123456A*" 700 800 100 False iRGBColor to iststatus
Get KusComBarCodeDraw128 of hImageobject "123456*" 1000 800 100 true iRGBColor to iststatus
//Wasserzeichen
Get KusComDrawText of hImageobject "nur für den internen .." 100 100 20 3 iRGBColor "Arial" True to iStatus
Get ComSaveAsTiff of hImageobject "c:\ditte3.tif" 2 to iStatus
Get ComCloseImage of hImageobject iClonedImageID to iststatus
Get KusComCloseNativeImage of hImageobject to iststatus
End_Procedure
End_Object
|
|
So habe ich alle Befehle, die ich brauche, in mein pkg integriert.
Den Befehlsumfang und die Beschreibung kann man unter
www.gdpicture.com
oder eine Hilfe zu den Befehlen unter
http://guides.gdpicture.com/v5/gdpicturepro/content/index.html
finden.
Gruss Dittmar
__________________ Dittmar
Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von Ditte: 04.05.2010 23:32.
|
|
04.05.2010 23:31 |
|
|
Roman Köhler
Administrator
    

Dabei seit: 29.08.2007
Beiträge: 202
Einsatzart von VDF: gewerblich Anwenderstatus: VDF-Entwickler Herkunft: Mannheim Betriebssystem: Windows XP
Themenstarter
 |
|
Hallo Dittmar,
ich könnte Dir natürlich jetzt auch per Mail antworten, aber dann hätte der Rest der Entwickler nix davon. Daher auf diesem Weg:
- Erst einmal herlichen Dank für Deine Unterstützung.
- Das Tool ist richtig klasse und nahezu alles, was ich wollte, bekam ich auf Anhieb hin. Den Rest mit Deiner Unterstützung.
- Ich kann mir definitiv nicht vorstellen, dass es vieles gibt, was man mit diesem Tool nicht hinbekommt. Also nochmals danke für den Tipp!
--> Wir haben das Control daher jetzt gekauft.
|
|
17.05.2010 16:28 |
|
|
|
|
|
 |
|