Es geht darum ein Image in einer Structure zu Speichern was ja normal auch kein Ding ist
z.b.
Code: Alles auswählen
Structure Bild
img.i
EndStructure
Define Image.Bild
Image\img=CreateImage(#PB_Any,800,600,32)
Ich habe mich mit Interface beschäftigt und war begeistert wie schön man damit Structure Händeln kann
Anbei noch der VideoLink wo Interface als Tutorial erklärt wird echt super https://www.youtube.com/watch?v=nX7ycvE ... mws4qHb-yi
z.b. Hier mein Interface mit Structure und deren Proceduren
Code: Alles auswählen
Interface _Quad
KillQuad()
SetQuad(x.f,y.f,b.f,h.f,img.i=#False)
CheckQuad.i(x.f,y.f)
GetQuadImage.i()
EndInterface
Structure QuadPoint
*quadZeiger
x.f
y.f
b.f
h.f
img.i
EndStructure
Procedure KillQuad (*this.QuadPoint)
If *this\img
FreeImage(*this\img)
EndIf
ClearStructure(*this,QuadPoint)
FreeMemory(*this)
EndProcedure
Procedure SetQuad (*this.QuadPoint,x.f,y.f,b.f,h.f,img.i=#False)
With *this
\x = x
\y = y
\b = b
\h = h
\img =img
EndWith
EndProcedure
Procedure.i CheckQuad (*this.QuadPoint,x.f,y.f)
If x=>*this\x And y=>*this\y And x<*this\b And y<*this\h
ProcedureReturn #True
EndIf
ProcedureReturn #False
EndProcedure
Procedure NewQuad ()
Protected *this.QuadPoint = AllocateMemory(SizeOf(QuadPoint))
If (Not *this)
ProcedureReturn #False
EndIf
With *this
\quadZeiger=?quadZeiger
\x = 0
\y = 0
\b = 0
\h = 0
\img = #False
EndWith
ProcedureReturn *this
EndProcedure
Procedure.i GetQuadImage (*this.QuadPoint)
ProcedureReturn *this\Img
EndProcedure
DataSection
quadZeiger:
Data.i @KillQuad(),@SetQuad(),@CheckQuad(),@NewQuad(),@GetQuadImage()
EndDataSection
Nun frage Ich mich warum dann diese nicht geht



Code: Alles auswählen
Define image1._Quad
;hier wird der Speicher Reserviert
image1=NewQuad()
;hier das Image in die Structure Gespeichert
image1\SetQuad(0,0,600,800,CreateImage(#PB_Any,800,600,32))
;und hier normal wieder ausgelesen Laut debug kommt auch die Zahl
SetGadgetState(imgWin,ImageID(image1\GetQuadImage()))



wäre Super wenn einer eine Idee hat
Gruss Silbersurfer