Arsip: How to make appearance smootly?

 
user image
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
user image
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 !
user image
more 15 years ago

herux

yg paling gampang u bisa manfatin AphaBlend and AlphaBlendValue property
user image
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..
user image
more 15 years ago

herux

Wah.. cepet amat responnya ??... kayak kecepatan application service ku .. hhe..he..he.. becanda bos.
user image
more 15 years ago

deLogic

@herux: kebetulan pas lagi di-refresh halaman LastPost nya bos, jadi langsung keliatan.. :)
user image
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....
user image
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
user image
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.
user image
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 attention
Lho, lha yang naruh di kamar itu siapa coba ? Yo wis, dipindahkan ke kategori yang layak.... :)
more ...
  • Pages:
  • 1
  • 2
  • 3
Share to

Random Topic

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