Also wieso schreibst nicht sowas hier?
Code: Alles auswählen
Global divisor.i = 80
Global smallImageWidth.i = 50
Global smallImageHeight.i = 50
;Global usw...

Code: Alles auswählen
Global divisor.i = 80
Global smallImageWidth.i = 50
Global smallImageHeight.i = 50
;Global usw...
Code: Alles auswählen
;-TOP
; ***************************************************************************************
;
; Comment :
; Author :
; Second Author :
; File :
; Version :
; Create :
; Update :
;
; Compilermode :
;
; ***************************************************************************************
EnableExplicit
;- Window Constants
;
Enumeration
#Main
;#Dialog1
EndEnumeration
;- Menubar Constants
;
Enumeration
#Main_Menu
EndEnumeration
;- MenuItem Constants
;
Enumeration
#Main_MenuItem_Exit
EndEnumeration
;- Gadget Constants
;
Enumeration
#Main_String
#Main_Button_Ok
;#Dialog1_Button_Ok
EndEnumeration
;- StatusBar Constants
;
Enumeration
#Main_Statusbar
EndEnumeration
;- Image Constants
;
Enumeration
#Image1
#Image2
EndEnumeration
;- Font Constants
;
Enumeration
#Font1
#Font2
EndEnumeration
;- Globale Variablen
;
Global ExitApplication
; ***************************************************************************************
Procedure Main()
Protected event, style
style = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget
OpenWindow(#Main, #PB_Ignore, #PB_Ignore, 400, 300, "Basis", style)
; Menu
CreateMenu(#Main_Menu, WindowID(#Main))
MenuTitle("Datei")
MenuItem(#Main_MenuItem_Exit, "Be&enden")
; Statusbar
CreateStatusBar(#Main_Statusbar, WindowID(#Main))
AddStatusBarField(100)
AddStatusBarField(#PB_Ignore)
StatusBarText(#Main_Statusbar, 0, "Version 1.0")
StatusBarText(#Main_Statusbar, 1, "Hello World")
; Gadgets
StringGadget(#Main_String, 10, 10, 300, 25, "Text")
ButtonGadget(#Main_Button_Ok, 10, 45, 120, 30, "Ok")
;- Main Eventloop
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_Menu
Select EventMenu()
Case #Main_MenuItem_Exit
ExitApplication = 1
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #Main_String
Select EventType()
Case #PB_EventType_Change
Debug "Change String: " + GetGadgetText(#Main_String)
Case #PB_EventType_LostFocus
Debug "Lostfocus String"
EndSelect
Case #Main_Button_Ok
Debug "Button Ok pressed"
EndSelect
Case #PB_Event_SizeWindow
Select EventWindow()
Case #Main
Debug "Main Window Resized"
EndSelect
Case #PB_Event_CloseWindow
Select EventWindow()
Case #Main
ExitApplication = 1
EndSelect
Case #PB_Event_Repaint
;
Case #PB_Event_MoveWindow
;
Case #PB_Event_ActivateWindow
;
Case #PB_Event_SysTray
;
EndSelect
Until ExitApplication = 1
EndProcedure : Main()
; ***************************************************************************************
Code: Alles auswählen
Global Dim fabox(200,200,3)
Declare BERECHNUNG()
Declare NEUZEICH()
Declare GESTALTUNG()
; ---------------------------------------------------------
EnableExplicit
Global P1_rot =0
Global P1_gruen =200
Global P1_blau =0
Global P2_rot =0
Global P2_gruen =0
Global P2_blau =0
Global P3_rot =0
Global P3_gruen =0
Global P3_blau =0
Global P4_rot =0
Global P4_gruen =0
Global P4_blau =0
Global Divisor =80
Global kl_bld_x =50
Global kl_bld_y =50
Global kl_bld_reihe= 1234
Global dip_seite_li=0
Global dip_seite_re=0
Global dip_seite_ob=0
Global Num_KB_1 = 4 ; kleines Bild links oben normal (4)
Global Num_KB_2 = 5 ; kleines Bild rechts oben normal (5)
Global Num_KB_3 = 6 ; kleines Bild rechts unten normal (6)
Global Num_KB_4 = 7 ; kleines Bild links unten normal (7)
Global kleinwahl = 0 ; welche bIlder sollen verkleinert werden
; 0= alle vier; 1=nur Li ob;
; 2=Li ob + Re ob ; 3=Li ob + Li un
Define quit=0
Define event=0
Define num=0
Define dipneu=0
Define aa$=""
Define a1=0
Define a2=0
Define a3=0
Define a4=0
Define dip=0
; ------------------------------------------------------------
OpenWindow(0, 0, 0, 450, 660, "FILLBOX", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CreateImage(0,200,200)
CreateImage(1,200,200)
CreateImage(2,200,200)
CreateImage(3,200,200)
; --
CreateImage(4,50,50)
CreateImage(5,50,50)
CreateImage(6,50,50)
CreateImage(7,50,50)
; --
CreateImage(8,200,200)
CreateImage(9,200,200)
CopyImage(0, 1)
CopyImage(0, 2)
CopyImage(0, 3)
; (Nr, x, y,Breite, Höhe;Inhalt$; Flag)
StringGadget( 0, 260, 10, 80, 20,Str(P1_rot), #PB_String_Numeric)
StringGadget( 1, 260, 35, 80, 20,Str(P1_gruen), #PB_String_Numeric)
StringGadget( 2, 260, 60, 80, 20,Str(P1_blau), #PB_String_Numeric)
StringGadget( 3, 260, 85, 80, 20,Str(P2_rot), #PB_String_Numeric)
StringGadget( 4, 260, 110, 80, 20,Str(P2_gruen), #PB_String_Numeric)
StringGadget( 5, 260, 135, 80, 20,Str(P2_blau), #PB_String_Numeric)
StringGadget( 6, 260, 160, 80, 20,Str(P4_rot), #PB_String_Numeric)
StringGadget( 7, 260, 185, 80, 20,Str(P4_gruen), #PB_String_Numeric)
StringGadget( 8, 260, 210, 80, 20,Str(P4_blau), #PB_String_Numeric)
StringGadget( 9, 260, 235, 80, 20,Str(P3_rot), #PB_String_Numeric)
StringGadget(10, 260, 260, 80, 20,Str(P3_gruen), #PB_String_Numeric)
StringGadget(11, 260, 285, 80, 20,Str(P3_blau), #PB_String_Numeric)
StringGadget(12, 260, 310, 80, 20,Str(Divisor), #PB_String_Numeric)
StringGadget(13, 260, 335, 80, 20,Str(kl_bld_x), #PB_String_Numeric)
StringGadget(14, 260, 360, 80, 20,Str(kl_bld_y), #PB_String_Numeric)
StringGadget(15, 260, 385, 80, 20,Str(kl_bld_Reihe), #PB_String_Numeric)
StringGadget(16, 260, 410, 80, 20,Str(kleinwahl), #PB_String_Numeric)
TextGadget(17,350, 13,80,20,"Li ob rot")
TextGadget(18,350, 38,80,20,"Li ob grn")
TextGadget(19,350, 63,80,20,"Li ob bla")
TextGadget(20,350, 88,80,20,"Re ob rot")
TextGadget(21,350,113,80,20,"Re ob grn")
TextGadget(22,350,138,80,20,"Re ob bla")
TextGadget(23,350,163,80,20,"Li un rot")
TextGadget(24,350,188,80,20,"Li un grn")
TextGadget(25,350,213,80,20,"Li un bla")
TextGadget(26,350,238,80,20,"Re un rot")
TextGadget(27,350,263,80,20,"Re un grn")
TextGadget(28,350,288,80,20,"Re un bla")
TextGadget(29,350,313,80,20,"Divisor ")
TextGadget(30,350,338,80,20,"Resize x ")
TextGadget(31,350,363,80,20,"Resize y ")
TextGadget(32,350,388,80,20,"Reihenfolge")
TextGadget(39,350,410,80,20,"Grabben")
TextGadget(33,350,435,80,20,Str(dip_seite_li))
TextGadget(34,350,460,80,20,Str(dip_seite_re))
TextGadget(35,350,485,80,20,Str(dip_seite_ob))
ButtonGadget(36,260,435,80,20,"Y-li abs",#PB_Button_Toggle)
ButtonGadget(37,260,460,80,20,"Y-re abs",#PB_Button_Toggle)
ButtonGadget(38,260,485,80,20,"X-ob abs",#PB_Button_Toggle)
ButtonGadget(40,260,510,80,20,"Neu Zeichnen",#PB_Button_Toggle)
; erstes Mal darstellen
BERECHNUNG()
NEUZEICH()
; Delay(20000)
quit=0
; -------Hauptschleife ------------
Repeat
Event = WaitWindowEvent()
If event=#PB_Event_CloseWindow:quit=1:EndIf
If event= #PB_Event_Gadget
num=EventGadget()
dipneu=0
Select num
Case 0
If EventType()= #PB_EventType_Change
;links oben rot
P1_rot=Val(GetGadgetText( 0))
If P1_rot>255:P1_rot=255:SetGadgetText(0,Str(P1_rot)):EndIf
If P1_rot< 0:P1_rot= 0:SetGadgetText(0,Str(P1_rot)):EndIf
dipneu=1
EndIf
Case 1
If EventType()= #PB_EventType_Change
;links oben gruen
P1_gruen=Val(GetGadgetText( 1))
If P1_gruen>255:P1_gruen=255:SetGadgetText(1,Str(P1_gruen)):EndIf
If P1_gruen< 0:P1_gruen= 0:SetGadgetText(1,Str(P1_gruen)):EndIf
dipneu=1
EndIf
Case 2
;links oben blau
If EventType()= #PB_EventType_Change
P1_blau=Val(GetGadgetText( 2))
If P1_blau>255:P1_blau=255:SetGadgetText(2,Str(P1_blau)):EndIf
If P1_blau< 0:P1_blau= 0:SetGadgetText(2,Str(P1_blau)):EndIf
dipneu=1
EndIf
Case 3
;rechts oben rot
If EventType()= #PB_EventType_Change
P2_rot=Val(GetGadgetText( 3))
If P2_rot>255:P2_rot=255:SetGadgetText(3,Str(P2_rot)):EndIf
If P2_rot< 0:P2_rot= 0:SetGadgetText(3,Str(P2_rot)):EndIf
dipneu=1
EndIf
Case 4
;rechts oben gruen
If EventType()= #PB_EventType_Change
P2_gruen=Val(GetGadgetText( 4))
If P2_gruen>255:P2_gruen=255:SetGadgetText(4,Str(P2_gruen)):EndIf
If P2_gruen< 0:P2_gruen= 0:SetGadgetText(4,Str(P2_gruen)):EndIf
dipneu=1
EndIf
Case 5
;rechts oben blau
If EventType()= #PB_EventType_Change
P2_blau=Val(GetGadgetText( 5))
If P2_blau>255:P2_blau=255:SetGadgetText(5,Str(P2_blau)):EndIf
If P2_blau< 0:P2_blau= 0:SetGadgetText(5,Str(P2_blau)):EndIf
dipneu=1
EndIf
Case 6
If EventType()= #PB_EventType_Change
; links unten rot
P4_rot=Val(GetGadgetText( 6))
If P4_rot>255:P4_rot=255:SetGadgetText(6,Str(P4_rot)):EndIf
If P4_rot< 0:P4_rot= 0:SetGadgetText(6,Str(P4_rot)):EndIf
dipneu=1
EndIf
Case 7
If EventType()= #PB_EventType_Change
; links unten gruen
P4_gruen=Val(GetGadgetText( 7))
If P4_gruen>255:P4_gruen=255:SetGadgetText(7,Str(P4_gruen)):EndIf
If P4_gruen< 0:P4_gruen= 0:SetGadgetText(7,Str(P4_gruen)):EndIf
dipneu=1
EndIf
Case 8
If EventType()= #PB_EventType_Change
; links unten blau
P4_blau=Val(GetGadgetText( 8))
If P4_blau>255:P4_blau=255:SetGadgetText(8,Str(P4_blau)):EndIf
If P4_blau< 0:P4_blau= 0:SetGadgetText(8,Str(P4_blau)):EndIf
dipneu=1
EndIf
Case 9
If EventType()= #PB_EventType_Change
; rechts unten rot
P3_rot=Val(GetGadgetText( 9))
If P3_rot>255:P3_rot=255:SetGadgetText(9,Str(P3_rot)):EndIf
If P3_rot< 0:P3_rot= 0:SetGadgetText(9,Str(P3_rot)):EndIf
dipneu=1
EndIf
Case 10
If EventType()= #PB_EventType_Change
; rechts unten gruen
P3_gruen=Val(GetGadgetText(10))
If P3_gruen>255:P3_gruen=255:SetGadgetText(10,Str(P3_gruen)):EndIf
If P3_gruen< 0:P3_gruen= 0:SetGadgetText(10,Str(P3_gruen)):EndIf
dipneu=1
EndIf
Case 11
If EventType()= #PB_EventType_Change
;rechts unten blau
P3_blau=Val(GetGadgetText(11))
If P3_blau>255:P3_blau=255:SetGadgetText(11,Str(P3_blau)):EndIf
If P3_blau< 0:P3_blau= 0:SetGadgetText(11,Str(P3_blau)):EndIf
dipneu=1
EndIf
Case 12
If EventType()= #PB_EventType_Change
; Divisor
Divisor =Val(GetGadgetText(12))
If Divisor>999: Divisor=200:SetGadgetText(12,Str(Divisor)):EndIf
If Divisor< 0: Divisor= 1:SetGadgetText(12,Str(Divisor)):EndIf
dipneu=1
EndIf
Case 13
If EventType()= #PB_EventType_Change
; x- groesse kleines Bild
kl_bld_x=Val(GetGadgetText(13))
If kl_bld_x>200:kl_bld_x=200:SetGadgetText(13,Str(kl_bld_x)):EndIf
If kl_bld_x< 0:kl_bld_x= 20:SetGadgetText(13,Str(kl_bld_x)):EndIf
dipneu=1
EndIf
Case 14
If EventType()= #PB_EventType_Change
; y-groesse kleines Bild
kl_bld_y=Val(GetGadgetText(14))
If kl_bld_y>200:kl_bld_y=200:SetGadgetText(14,Str(kl_bld_y)):EndIf
If kl_bld_y< 0:kl_bld_y= 20:SetGadgetText(14,Str(kl_bld_y)):EndIf
dipneu=1
EndIf
Case 15
If EventType()= #PB_EventType_Change
; reihenfolge der 4 kleinen Bilder im Uhrzeigersinn L o => L u
aa$=GetGadgetText(15)
a1=Val(Mid(aa$,1,1))
a2=Val(Mid(aa$,2,1))
a3=Val(Mid(aa$,3,1))
a4=Val(Mid(aa$,4,1))
If a1<0 : a1=1 : EndIf
If a1>4 : a1=4 : EndIf
If a2<0 : a2=1 : EndIf
If a2>4 : a2=4 : EndIf
If a3<0 : a3=1 : EndIf
If a3>4 : a3=4 : EndIf
If a4<0 : a4=1 : EndIf
If a4>4 : a4=4 : EndIf
kl_bld_Reihe=a1*1000+a2*100+a3*10+a4
Num_KB_1=a1+3
Num_KB_2=a2+3
Num_KB_3=a3+3
Num_KB_4=a4+3
dipneu=1
EndIf
Case 16
If EventType()= #PB_EventType_Change
; welche Bilder sollen gegrabbt werden für resize
kleinwahl=Val(GetGadgetText(16))
If kleinwahl>3:kleinwahl=3:SetGadgetText(16,Str(kleinwahl)):EndIf
If kleinwahl<0:kleinwahl=0:SetGadgetText(16,Str(kleinwahl)):EndIf
dipneu=2
EndIf
Case 36
dip=GetGadgetState(36)
dip_seite_li=dip
TextGadget(33,350,435,80,20,Str(dip_seite_li))
dipneu=1
Case 37
dip=GetGadgetState(37)
dip_seite_re=dip
TextGadget(34,350,460,80,20,Str(dip_seite_re))
dipneu=1
Case 38
dip=GetGadgetState(38)
dip_seite_ob=dip
TextGadget(35,350,485,80,20,Str(dip_seite_ob))
dipneu=1
Case 40
dip=GetGadgetState(40)
If dip=1
SetGadgetText(15,Str(kl_bld_Reihe))
;BERECHNUNG()
NEUZEICH()
SetGadgetState(40,0)
EndIf
EndSelect
EndIf
If dipneu=1
BERECHNUNG()
EndIf
If dipneu=2
BERECHNUNG()
GESTALTUNG()
EndIf
Until quit=1
End
; +++++++++++++++++++++++++++++++++++++++++++++++++++++
Procedure BERECHNUNG()
; ---------------------------------------
; Berechnungen
; ---------------------------------------
Static FaP1
Static FaP2
Static FaP3
Static Fap4
Static qx,qy
Static DiffLiro
Static DiffLigr
Static DiffLibl
Static FaLiro
Static FaLigr
Static FaLibl
Static DiffRero
Static DiffRegr
Static DiffRebl
Static DiffObRo
Static DiffObgr
Static DiffObbl
Static FaRero
Static FaRegr
Static FaRebl
Static farbe
Static farv
Static fagv
Static fabv
Static farh
Static fagh
Static fabh
Static f01,f02,f03,f11,f12,f13,f21,f22,f23,f31,f32,f33
FaP1 =RGB(P1_rot,P1_gruen,P1_blau)
FaP2 =RGB(P2_rot,P2_gruen,P2_blau)
FaP3 =RGB(P3_rot,P3_gruen,P3_blau)
FaP4 =RGB(P4_rot,P4_gruen,P4_blau)
For qy=0 To 199
; linke Seite Differenz Linksoben - linksunten evtl negativ
If dip_seite_li=0
DiffLiro=P1_rot-P4_rot
DiffLigr=P1_gruen-P4_gruen
DiffLibl=P1_blau-P4_blau
EndIf
; linke Seite Differenz Linksoben - Linksunten Absolutwert
If dip_seite_li=1
DiffLiro=Abs(P1_rot-P4_rot)
DiffLigr=Abs(P1_gruen-P4_gruen)
DiffLibl=Abs(P1_blau-P4_blau)
EndIf
; If dip_seite_li=1
; DiffLiro=P1_rot-P4_rot
; DiffLigr=P1_gruen-P4_gruen
; DiffLibl=P1_blau-P4_blau
; If DiffLiro<0 :DiffLiro=DiffLiro*(-1):EndIf
; If DiffLigr<0 :DiffLigr=DiffLigr*(-1):EndIf
; If DiffLibl<0 :DiffLibl=DiffLibl*(-1):EndIf
;
; EndIf
;berechnen des Punktes auf der y-Achse ( Linksdiffernz/ Divisor*yStrecke
FaLiRo=P1_rot+(Int(DiffLiro/Divisor)*qy)
FaLigr=P1_gruen+(Int(DiffLigr/Divisor)*qy)
FaLibl=P1_blau+(Int(DiffLibl/Divisor)*qy)
; ---
; rechte Seite Differenz Linksoben - linksunten evtl negativ
If dip_seite_re=0
DiffRero=P2_rot-P3_rot
DiffRegr=P2_gruen-P3_gruen
DiffRebl=P2_blau-P3_blau
EndIf
; rechte Seite Differenz Linksoben - Linksunten Absolutwert
If dip_seite_re=1
DiffRero=Abs(P2_rot-P3_rot)
DiffRegr=Abs(P2_gruen-P3_gruen)
DiffRebl=Abs(P2_blau-P3_blau)
EndIf
;berechnen des Punktes auf der y-Achse ( rechtsdiffernz/ Divisor*yStrecke
FaRero=P2_rot+(Int(DiffRero/Divisor)*qy)
FaRegr=P2_gruen+(Int(DiffRegr/Divisor)*qy)
FaRebl=P2_blau+(Int(DiffRebl/Divisor)*qy)
;
; berechnen der Differenz zwischen rechts und links
; If dip_seite_ob=0
diffobro=FaLiRo-FaRero
diffobgr=FaLigr-FaRegr
diffobbl=FaLibl-FaRebl
; EndIf
; If dip_seite_ob=1
; diffro=Abs(FaLiRo-FaRero)
; diffgr=Abs(FaLigr-FaRegr)
; diffbl=Abs(FaLibl-FaRebl)
; EndIf
; For qx=0 To 199
; fabox(qx,qy,1)=FaLiRo+(Int(diffro/Divisor))*qx
; fabox(qx,qy,2)=FaLigr+(Int(diffgr/Divisor))*qx
; fabox(qx,qy,3)=FaLibl+(Int(diffbl/Divisor))*qx
; Next qx
For qx=0 To 199
; X-Achse Differenz links und rechts evtl negativ
If dip_seite_ob=0
fabox(qx,qy,1)=FaLiRo+(Int((diffobro/Divisor)*qx))
fabox(qx,qy,2)=FaLigr+(Int((diffobgr/Divisor)*qx))
fabox(qx,qy,3)=FaLibl+(Int((diffobbl/Divisor)*qx))
EndIf
; x-achse Differenz links und rechts absolut
If dip_seite_ob=1
If FaLiRo<FaRero : fabox(qx,qy,1)=fabox(qx,qy,1)*(-1) : EndIf
If FaLigr<FaRegr : fabox(qx,qy,2)=fabox(qx,qy,2)*(-1) : EndIf
If FaLibl<FaRebl : fabox(qx,qy,3)=fabox(qx,qy,3)*(-1) : EndIf
EndIf
Next qx
Next qy
; -----Bild 0 erzeugen ------------------------------------
StartDrawing(ImageOutput(0))
For qy= 0 To 199
For qx= 0 To 199
farbe=RGB(fabox(qx,qy,1),fabox(qx,qy,2),fabox(qx,qy,3))
Plot (qx,qy,farbe)
Next qx
Next qy
StopDrawing()
CopyImage(0, 4)
ResizeImage(4,100,100)
; --------Bild 0 fertig -----------------------
; --------Bild 1 erzeugen ---------------------
; flip horizontal Bild0
StartDrawing(ImageOutput(1))
For qy=0 To 199
For qx=0 To 99
farv=fabox(199-qx,qy,1)
fagv=fabox(199-qx,qy,2)
fabv=fabox(199-qx,qy,3)
Plot(qx,qy,RGB(farv,fagv,fabv))
farh=fabox(qx,qy,1)
fagh=fabox(qx,qy,2)
fabh=fabox(qx,qy,3)
Plot (199-qx,qy,RGB(farh,fagh,fabh))
Next qx
Next qy
StopDrawing()
CopyImage(1, 5)
ResizeImage(5,100,100)
; -------Bild 1 fertig ------------------------
; --------Bild 2 erzeugen ---------------------
; flip vertikal+horizontal bild0
StartDrawing(ImageOutput(2))
For qy=0 To 99
For qx=0 To 99
f01=fabox(qx,qy,1)
f02=fabox(qx,qy,2)
f03=fabox(qx,qy,3)
f11=fabox(199-qx,qy,1)
f12=fabox(199-qx,qy,2)
f13=fabox(199-qx,qy,3)
f21=fabox(199-qx,199-qy,1)
f22=fabox(199-qx,199-qy,2)
f23=fabox(199-qx,199-qy,3)
f31=fabox(qx,199-qy,1)
f32=fabox(qx,199-qy,2)
f33=fabox(qx,199-qy,3)
Plot(qx,qy,RGB(f21,f22,f23))
Plot(199-qx,qy,RGB(f31,f32,f33))
Plot(199-qx,199-qy,RGB(f01,f02,f03))
Plot(qx,199-qy,RGB(f11,f12,f13))
Next qx
Next qy
StopDrawing()
CopyImage(2, 6)
ResizeImage(6,100,100)
; --------Bild 3 fertig ---------------------
; --------Bild 3 erzeugen ---------------------
; flip vertikal bild0
StartDrawing(ImageOutput(3))
For qy=0 To 99
For qx=0 To 199
farv= fabox(qx,199-qy,1)
fagv= fabox(qx,199-qy,2)
fabv= fabox(qx,199-qy,3)
Plot(qx,qy,RGB(farv,fagv,fabv))
farh= fabox(qx,qy,1)
fagh= fabox(qx,qy,2)
fabh= fabox(qx,qy,3)
Plot (qx,199-qy,RGB(farh,fagh,fabh))
Next qx
Next qy
StopDrawing()
CopyImage(3, 7)
ResizeImage(7,100,100)
; --------Bild 3 fertig ---------------------
EndProcedure
; +++++++++++++++++++++++++++++++++++++++++++++++++++++
; +++++++++++++++++++++++++++++++++++++++++++++++++++++
Procedure NEUZEICH()
StartDrawing(WindowOutput(0))
FrontColor(RGB(220,220,220)):Box(10,10,200,200)
DrawImage(ImageID(0), 10, 10)
FrontColor(RGB(220,220,220)):Box(10,225,200,200)
If Num_KB_1>3:DrawImage(ImageID(Num_KB_1), 10,225):EndIf
If Num_KB_2>3:DrawImage(ImageID(Num_KB_2),110,225):EndIf
If Num_KB_3>3:DrawImage(ImageID(Num_KB_3),110,325):EndIf
If Num_KB_4>3:DrawImage(ImageID(Num_KB_4), 10,325):EndIf
FrontColor(RGB(220,220,220)):Box(10,440,200,200)
;DrawImage(ImageID(8),10,440)
DrawImage(ImageID(9),10,440)
ResizeImage(9,kl_bld_x,kl_bld_y)
DrawImage(ImageID(9),10,440)
StopDrawing()
EndProcedure
; +++++++++++++++++++++++++++++++++++++++++++++++++++++
; +++++++++++++++++++++++++++++++++++++++++++++++++++++
Procedure GESTALTUNG()
Static xg=0 ;x_größe
Static yg=0 ; yGröße
StartDrawing(WindowOutput(0))
FreeImage(8)
FreeImage(9)
If kleinwahl=0:xg=200:yg=200:EndIf
If kleinwahl=1:xg=100:yg=100:EndIf
If kleinwahl=2:xg=200:yg=100:EndIf
If kleinwahl=3:xg=100:yg=200:EndIf
CreateImage(8,xg,yg)
CreateImage(9,xg,yg)
;StartDrawing(ImageOutput(8))
GrabDrawingImage(8,10,225,xg,yg)
StopDrawing()
CopyImage(8,9)
;ResizeImage(9,kl_bld_x,kl_bld_y)
EndProcedure
; +++++++++++++++++++++++++++++++++++++++++++++++++++++
Oder soetwas:NicTheQuick hat geschrieben:Also ich blicke da bei deinem Code nicht ganz durch, weil du immer dieses komische nichtssagende Array 'gg()' nutzt anstatt sprechender Variablennamen.
Code: Alles auswählen
Structure ggStructure
Divisor.l
Size.l
Left.l
Right.l
X.l
FlipH.l
FlipV.l
EndStructure
Global gg.ggStructure
gg\Divisor = 80
gg\Size = 50
gg\Left = 1
gg\Right = 1
gg\X = 0
gg\FlipH = 0
gg\FlipV = 0
Code: Alles auswählen
Procedure NEUZEICH()
; Image mit ID 9 neuerstellen
CreateImage(9,200,200)
StartDrawing(ImageOutput(9))
FrontColor(RGB(220,220,220)):Box(0,0,200,200)
If Num_KB_1>3:DrawImage(ImageID(Num_KB_1), 0,0):EndIf
If Num_KB_2>3:DrawImage(ImageID(Num_KB_2),100,0):EndIf
If Num_KB_3>3:DrawImage(ImageID(Num_KB_3),100,100):EndIf
If Num_KB_4>3:DrawImage(ImageID(Num_KB_4), 0,100):EndIf
StopDrawing()
StartDrawing(WindowOutput(0))
FrontColor(RGB(220,220,220)):Box(10,10,200,200)
DrawImage(ImageID(0), 10, 10)
DrawImage(ImageID(9), 10, 225)
ResizeImage(9,kl_bld_x,kl_bld_y)
DrawImage(ImageID(9),10,440)
StopDrawing()
EndProcedure
Code: Alles auswählen
Repeat
Event = WaitWindowEvent()
If event=#PB_Event_CloseWindow:quit=1:EndIf
If event = #PB_Event_Repaint
NEUZEICH()
EndIf
Code: Alles auswählen
Procedure NEUZEICH()
; Image mit ID 9 neuerstellen
CreateImage(9,200,200)
StartDrawing(ImageOutput(9))
FrontColor(RGB(220,220,220)):Box(0,0,200,200)
If Num_KB_1>3:DrawImage(ImageID(Num_KB_1), 0,0):EndIf
If Num_KB_2>3:DrawImage(ImageID(Num_KB_2),100,0):EndIf
If Num_KB_3>3:DrawImage(ImageID(Num_KB_3),100,100):EndIf
If Num_KB_4>3:DrawImage(ImageID(Num_KB_4), 0,100):EndIf
StopDrawing()
StartDrawing(WindowOutput(0))
FrontColor(RGB(220,220,220)):Box(10,10,200,200)
DrawImage(ImageID(0), 10, 10)
DrawImage(ImageID(9), 10, 225)
ResizeImage(9,kl_bld_x,kl_bld_y)
FrontColor(RGB(220,220,220)):Box(10,440,200,200)
DrawImage(ImageID(9),10,440)
StopDrawing()
EndProcedure
Aktuelle Ausgabe bedeutet zwischen StartDrawing und StopDrawingSyntax
Ergebnis = GrabDrawingImage(#Image, x, y, Breite, Höhe)
Beschreibung
Erstellt ein neues Bild (englisch "Image) mit dem Inhalt des angegebenen Bereichs in der aktuellen Ausgabe.