Hi, Norman,
I drag a picture to a canvas and I want to save it to a destination
I succeeded
(I n my code the source is called bron
The destination is called doel.
I know that Select Case would have been a better choice than using if then, but ok it works.
msgbox " Verplaats de afbeelding naar het bureaublad en sleep opnieuw!" means put
I am wondering if there is no smarter way and making a folderitem.name out of a string could have been nice , but I do believe you it is not possible, even as my name is Thomas.
This is the code:
If Obj.PictureAvailable then
me.backdrop=obj.picture
Elseif Obj.FolderItemAvailable then
me.backdrop=Picture.Open(obj.FolderItem)
End if
dim p1 as string
dim p2 as string
dim p3 as string
dim p4 as string
dim p5 as String
dim p6 as string
dim p7 as string
dim p8 as string
dim p9 as string
dim p10 as string
dim p11 as string
dim tom as string
dim tom2 as string
dim p21 as string
dim tomx as String
Dim x as integer
dim cw as integer
dim ch as integer
dim last as integer
dim i as integer
dim bron as folderitem
dim doel as folderitem
dim stringteller as string
If Obj.PictureAvailable then
Me.backdrop=Obj.Picture
Canvas2.Width = Obj.Picture.Width
Canvas2.Height = Obj.Picture.Height
elseif Obj.FolderItemAvailable then
Me.backdrop=Picture.Open(obj.FolderItem)
cw = Picture.Open(obj.FolderItem).Width
ch = Picture.Open(obj.FolderItem).Height
Canvas1.width = cw
Canvas1.height = ch
dim p as string
p = obj.FolderItem.name
dim s2 as string
Me.name = obj.FolderItem.AbsolutePath
s2= me.name
Windowverder.Textarea1.text = Windowverder.Textarea1.text + s2+ endofline +endofline
dim f as folderitem
dim ft as FolderItem
Dim file as TextInputStream
dim opteller as integer
Dim Wegschrijfnaam as string
Rem Just to give a name
ft = Volume(V).child("Meander").child("RB").child("telnummer.txt")
file=TextInputStream.Open(ft)
if ft <>nil then
stringteller = str(file.readline)
TN2.text = TN2.text + str(opteller)
Wegschrijfnaam = stringteller +"---"+(p)
file.close
Listbox1.addrow str(Wegschrijfnaam)
end if
REM ======
Dim s as String
tom = s2
s= tom
Windowverder.Textarea1.text = Windowverder.Textarea1.text + "OK" + endofline+ endofline+ endofline
If TargetWin32 then
last=CountFields(s,"\")
For i=1 to last
listbox4.addRow NthField(s,"\",i)
T1.text =T1.text +str(NthField(s,"\",i))
Next
end if
If TargetMacOS then
last=CountFields(s,":")
For i=1 to last
listbox4.addRow NthField(s,":",i)
T1.text =T1.text +str(NthField(s,":",i))
if i > 1 then
tomx = tomx + ".child(" + str(NthField(s,":",i)) +")"
end if
Next
tom2 = tomx
Windowverder.Textarea1.text = Windowverder.Textarea1.text + tom2 + " is de bron." + EndOfLine
end if
tom2 = "Volume(0)" +tom2
//bron.name = tom2
for x = 0 to listbox4.ListCount-1
Listbox4.cell(x,2) = str(Listbox4.cell(x,0))
next
end if
if last = 6 then
p2 = Listbox4.cell (0,0)
p3 = Listbox4.cell (1,0)
p4 = Listbox4.cell (2,0)
p5 = Listbox4.cell (3,0)
p6= Listbox4.cell (4,0)
p7 = Listbox4.cell (5,0)
p21 = p7
bron = Volume(0).child(p3).child(p4).child(p5).child(p6).child(p7)
doel = Volume(V).child("Meander").child("RB").child("Plaatjes2").child(stringteller +"---"+p7)
bron.copyfileto(doel)
p21 = p7
listbox1.addrow (p21)
end if
if last = 5 then
p2 = Listbox4.cell (0,0)
p3 = Listbox4.cell (1,0)
p4 = Listbox4.cell (2,0)
p5 = Listbox4.cell (3,0)
p6= Listbox4.cell (4,0)
p21 = p6
REM copying
bron = Volume(0).child(p3).child(p4).child(p5).child(p6)
doel = Volume(V).child("Meander").child("RB").child("Plaatjes2").child(stringteller +"---"+p6)
bron.copyfileto(doel)
p21 = p6
listbox1.addrow (p21)
end if
if last >6 Or last <5 then
msgbox " Put the picture on the desktop and drag it to the square"
end if
if last > 10 Or last <4 then
msgbox " Put the picture on the desktop and drag it to the square"
end if
REM Cruciaal!!
Listbox4.DeleteAllRows