Arsip: How to make appearance smootly?
more 15 years ago
johnizzy
my question is simple, example i have a bottom (on form1) that will call form2.
so if i press it i ll be showed form2.
but i wanna make form2 appear smootly...,seems like delay and slowly
more 15 years ago
deLogic
use animation effects, for example by using AnimateWindow function.
AnimateWindow Function The AnimateWindow function enables you to produce special effects when showing or hiding windows. There are four types of animation: roll, slide, collapse or expand, and alpha-blended fade. Syntax BOOL AnimateWindow( HWND hwnd, DWORD dwTime, DWORD dwFlags ); Parameters hwnd [in] Handle to the window to animate. The calling thread must own this window. dwTime [in] Specifies how long it takes to play the animation, in milliseconds. Typically, an animation takes 200 milliseconds to play. dwFlags [in] Specifies the type of animation. This parameter can be one or more of the following values. Note that, by default, these flags take effect when showing a window. To take effect when hiding a window, use AW_HIDE and a logical OR operator with the appropriate flags. AW_SLIDE Uses slide animation. By default, roll animation is used. This flag is ignored when used with AW_CENTER. AW_ACTIVATE Activates the window. Do not use this value with AW_HIDE. AW_BLEND Uses a fade effect. This flag can be used only if hwnd is a top-level window. AW_HIDE Hides the window. By default, the window is shown. AW_CENTER Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used. The various direction flags have no effect. AW_HOR_POSITIVE Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND. AW_HOR_NEGATIVE Animates the window from right to left. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND. AW_VER_POSITIVE Animates the window from top to bottom. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND. AW_VER_NEGATIVE Animates the window from bottom to top. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND. Return Value If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. The function will fail in the following situations: If the window uses the window region. Windows XP: This does not cause the function to fail. If the window is already visible and you are trying to show the window. If the window is already hidden and you are trying to hide the window. If there is no direction specified for the slide or roll animation. When trying to animate a child window with AW_BLEND. If the thread does not own the window. Note that, in this case, AnimateWindow fails but GetLastError returns ERROR_SUCCESS. To get extended error information, call the GetLastError function.Don't ask me the code, I think it is very clear. Read It, Try It, Play It and let you decide !
more 15 years ago
deLogic
property AlphaBlend & AlphaBlendValue tidak menggunakan delay untuk penayangan jendela, jadi harus ditambahkan sendiri prosedur untuk memberikan effect fade-in dan fade-out nya..
more 15 years ago
herux
Wah.. cepet amat responnya ??... kayak kecepatan application service ku ..
hhe..he..he.. becanda bos.
more 15 years ago
deLogic
@herux:
kebetulan pas lagi di-refresh halaman LastPost nya bos, jadi langsung keliatan.. :)
more 15 years ago
johnizzy
@deLogic: property AlphaBlend & AlphaBlendValue tidak menggunakan delay untuk penayangan jendela, jadi harus ditambahkan sendiri prosedur untuk memberikan effect fade-in dan fade-out nya..sohib logic, ada ga contoh sample untuk bisa buat efek fade in fade out seperti itu.... uraian ente di atas kayaknya terlalu teoritis atau mungkin ane yang masih o'on... thanks for help, johnizzy now back home no western more, :wink: xixixixii....
more 15 years ago
johnizzy
apa ga enak topik ini ditaruh di tips dan trik aja...
soale kan pertanyaan ane kan ga ada hubungannya dengan database, apalagi MySQL...
for @Admin, thanks for the attention
more 15 years ago
deLogic
@johnizzy
untuk efek muncul secara perlahan, iterasikan nilai 0 hingga 255 ke properti AlphaBlendValue
Sebaliknya untuk efek hilang secara perlahan, iterasikan nilai 255 hingga 0 ke properti AlphaBlendValue
Contoh:
procedure TForm2.FormActivate(Sender: TObject);
var
I : Integer;
begin
for I := 0 to 255 do
begin
AlphaBlendValue := I;
end;
end;
Ingat, kode diatas cuman ilustrasi saja, silahkan bereksperimen dan optimalisasikan performa dan efek-nya... try It, play It and let you decide.
more 15 years ago
deLogic
@johnizzy: apa ga enak topik ini ditaruh di tips dan trik aja... soale kan pertanyaan ane kan ga ada hubungannya dengan database, apalagi MySQL... for @Admin, thanks for the attentionLho, lha yang naruh di kamar itu siapa coba ? Yo wis, dipindahkan ke kategori yang layak.... :)
more ...
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- ask - edit posting tidak berhasil
by cyber_hecker in Moderator Only more 17 years ago - [release] PooLander!
by ZeAL in Games more 19 years ago - Simpan file multimedia ke database
by myluqman in Multimedia & Graphic Enhancement more 17 years ago - MErdeka
by nurez in OOT more 17 years ago - [ASK] gimana caranya connect client ke server MySQL
by shindo in Hal umum tentang Pascal Indonesia more 16 years ago - MDIChild in dll
by simple_code in Tip n Trik Pemrograman more 16 years ago - Ternyata programmer bisa juga jadi milyuner
by delphinewbie in OOT more 17 years ago - sistem pakar
by Theo_razor in Tutorial & Community Project more 16 years ago - Help - Problem kirim sms dengan Comport
by batozai in Network, Files, I/O & System more 14 years ago - [ask] repair table mysql dengan delphi
by mario_budhi in MySQL more 18 years ago