Arsip: drag and drop

 
user image
more 10 years ago

andry_yang

kk..............gimana c caranya buat drag n drop image yang smooth (tidak patah2)?? saya sudah mengaktifkan DoubleBuffered tp ttp aj patah2...... thx b4.........
user image
more 10 years ago

heriy4nt0

Drag n drop image - maksudnya yang patah2 apa ya ? bukannya waktu drag n drop cuma terlihat kotak segiempat kecil aja -- atau kamu gambar ya imagenya waktu proses drag n drop ? ..sepertinya perlu jelaskan mendetail lagi ..
user image
more 10 years ago

andry_yang

hmm.....gini kk...............aku kan nampilin gambar d TImage, trs pengen waktu d run, gambar tersebut d bs di gerakin gitu (maksudny drag n drop disini gitu). bener kata kk wkt d drag n drop terlihat kotak segiempat kecil, tp pergerakan gambar ny tu patah2 (ga smooth) dan suka ga pindah gambarny, pengenny ga patah2 kaya ngegerakin form...... apa cukup detail kak??maap kl pertanyaan kurang mendetail.......
user image
more 10 years ago

heriy4nt0

contoh drag drop image pada form --------------- //image event //------------------ procedure TForm4.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Button = mbLeft then Image1.BeginDrag(False); end; procedure TForm4.Image1EndDrag(Sender, Target: TObject; X, Y: Integer); begin if Target <> nil then Image1.Update; end; //form event //------------------ procedure TForm4.FormDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin if Source is TImage then Accept :=True else Accept:=False; end; procedure TForm4.FormDragDrop(Sender, Source: TObject; X, Y: Integer); begin with Source as TImage do begin Left:=X; Top:=Y; end; end; ---------------------------------- tidak terjadi flicker, boleh lihat source code kamu ?
user image
more 10 years ago

andry_yang

kk in source code saya sebelum dtambah ma yg pnya kk...... //image event //------------------- procedure TFormCreation.ImageAlis1DragDrop(Sender, Source: TObject; X, Y: Integer); begin if Source is TImage then begin TImage(Source).Left := X; TImage(Source).Top := Y; end; end; procedure TFormCreation.ImageAlis1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin Accept := Source is TImage; end; //form event //------------------- procedure TFormCreation.FormCreate(Sender: TObject); begin DoubleBuffered := true; end; ------------------------------------------------------------------------------------ setelah ditambah pnya kk..... //image event //------------------- procedure TFormCreation.ImageAlis1DragDrop(Sender, Source: TObject; X, Y: Integer); begin if Source is TImage then begin TImage(Source).Left := X; TImage(Source).Top := Y; end; end; procedure TFormCreation.ImageAlis1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin Accept := Source is TImage; end; procedure TFormCreation.ImageAlis1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Button = mbLeft then ImageAlis1.BeginDrag(False); end; procedure TFormCreation.ImageAlis1EndDrag(Sender, Target: TObject; X, Y: Integer); begin if Target <> nil then ImageAlis1.Update; end; //form event //------------------- procedure TFormCreation.FormCreate(Sender: TObject); begin DoubleBuffered := true; end; procedure TFormCreation.FormDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin if Source is TImage then Accept :=True else Accept:=False; end; procedure TFormCreation.FormDragDrop(Sender, Source: TObject; X, Y: Integer); begin with Source as TImage do begin Left:=X; Top:=Y; end; end; ------------------------------------------------------------------------------------- tp ko permasalahanny masih sama y(baik source code saya, setelah ditambah pny kk maupun hanya menggunakan source code pny kk saja)??gambar ny ga bs langsung pindah berbarengan dengan waktu d drag, tp pindahny setelah d drop.....tp kadang2 jg ga pindah (susah pindahnya)........maap y kk ngerepotin......... btw mo nny.........kl kk tu pengelola situs in y??update bgt ma masalah2 kaum newbie seperti saya.....thx y atas bantuanny.........
user image
more 10 years ago

andry_yang

oya kk drag mode ny tu dmAutomatic ato dmManual??
user image
more 10 years ago

heriy4nt0

@andry_yang: btw mo nny.........kl kk tu pengelola situs in y??update bgt ma masalah2 kaum newbie seperti saya.....thx y atas bantuanny.........
hehe..aq bukan pengelola situs ini, aq sama seperti kamu - newbie juga - makanya sesama newbie harus update hehe, kebetulan aja kemarin aplikasi aq juga perlu proses drag drop.
@andry_yang: oya kk drag mode ny tu dmAutomatic ato dmManual??
property drag --> dmManual (Default)
user image
more 10 years ago

andry_yang

owh......thx kk atas bantuanny y........oya blh nanya2 beberapa hal lagi??kk tau caranya buat button save untuk ngsave beberapa TImage menjadi 1 image ga? in source code puny saya, tp source code in cm bs ngsave 1 TImage menjadi 1 image.... ----------------------------------------------------------------------------------------- procedure TFormCreation.ButtonSimpanClick(Sender: TObject); begin if(SavePictureDialog.Execute) then begin ImageFoto.Picture.SaveToFile(SavePictureDialog.FileName); end; end; -----------------------------------------------------------------------------------------
user image
more 10 years ago

heriy4nt0

maksudnya ngesave beberapa image sekaligus ya ? 1. tentukan nama filenya lebih dulu - karena nama file harus belum ada dalam directory, cth : image01.jpg, image02.jpg,image03.jpg. 2. looping seluruh image yang ada(kalau imagenya tidak ditentukan dan dapat berubah banyaknya) 3. algorithm.. for i:=0 to componentcount-1 do if components[i] is timage then //tentukan nama file mis: image01.jpg //cek nama file jika telah ada di komputer - looping untuk generate nama file yang baru if fileexists(namafile) then while fileexists(namafile) do (generate namafile yang baru) //simpan image ke harddisk with components[i] as timage do savetofile... //end blok if components[i] //end blok for i
user image
more 10 years ago

andry_yang

hmm............kk maap saya kurang mengerti..................software sy tu mis seperti ini : image1 : foto saya image2 : topi image3 : kumis pengen bisa disave langsung jd 1 image yaitu foto saya yg telah dilengkapi topi n kumis............ky photo box gitu kk.......maap..........
more ...
  • Pages:
  • 1
  • 2
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com