نمایش نتایج 1 تا 40 از 68

نام تاپیک: تکه کد های جالب

Threaded View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #8
    کاربر دائمی آواتار mehran_337
    تاریخ عضویت
    مهر 1384
    محل زندگی
    رشت
    پست
    1,305
    با کسب اجازه از حامد عزیزم من هم کدهایی که دارم را در این تاپیک که ایده قشنگ ایشان بود می زارم
    این کد یک فرم با عکس که از روی هارد می دهیم می سازد و با کارکترها طوری کار می کند که انگار روی عکس برف در حال باریدن است




    ************************************************** ********
    ** Author : Ramani (Subramanian.G)
    ** FoxAcc Software / Winners Software
    ** Type : Freeware with reservation to Copyrights
    ** Warranty : Nothing implied or explicit
    ************************************************** ********
    tCaption1 = "Seasons Greetings .. "
    tCaption2 = ".. & Happy New Year - Ramani"
    tImage = "G:\picture\new pic\ XP Wallpapers\0002.jpg"
    =gsGreet(tCaption1,tCaption2,tImage)
    **********************************************


    **********************************************
    ** gsGreet.PRG
    ** How to run ..
    ** =gsGreet(tCaption1,tCaption2,tImage)
    ** You can use your own Bmp or Gif file
    ** You can also save the picture above as xmas.jpg
    ** by right click mouse over it and save that
    ** in the same place as you save this prg.
    **********************************************
    * Greetings Card form
    PROCEDURE gsGreet
    PARAMETERS tCaption1, tCaption2, tImage

    PUBLIC oform1
    oform1=NEWOBJECT("gForm",'','',tCaption1,tCaption2 , tImage)
    oForm1.TitleBar = 0 && if you wish to have no titlebar
    oform1.Show
    RETURN
    **********************************************
    **********************************************
    DEFINE CLASS gForm AS form

    Height = 454
    Width = 633
    DoCreate = .T.
    BackColor = RGB(0,0,128)
    Name = "Greetings"
    cSnow = "'"
    nSnow = 0
    nSnowFont = 20

    Add object Text1 as label with ;
    AutoSize = .T., ;
    BackStyle = 0, ;
    FontBold = .T., ;
    FontItalic = .T., ;
    FontSize = 24, ;
    Left = 24, ;
    Name = "Text1"

    Add object Text2 as label with ;
    AutoSize = .T., ;
    BackStyle = 0, ;
    FontBold = .T., ;
    FontItalic = .T., ;
    FontSize = 24, ;
    Left = 96, ;
    Name = "Text2"

    PROCEDURE init
    LPARAMETERS tCaption1, tCaption2, tGif

    IF EMPTY(tCaption2)
    tCaption2 = "from Ramani (Subramanian.G)"
    ENDIF
    IF EMPTY(tCaption1)
    tCaption1 = "Greetings !!!"
    ENDIF
    WITH ThisForm
    .Text1.Caption = tCaption1
    .Text2.Caption = tCaption2
    .Text1.Top = .Height - 72
    .Text2.Top = .Height -36
    IF !FILE(tGif)
    .cSnow = "*"
    .nSnowFont = 36
    ELSE
    .BackColor = RGB(253,254,249)
    .ADDOBJECT("Image1","Image")
    WITH .Image1
    .Picture = tGif
    .Stretch = 2
    .Width = ThisForm.Width
    .Height = ThisForm.Height - 72
    .Top = 0
    .Left = 0
    .Zorder(1)
    .Visible = .t.
    ENDWITH
    ENDIF
    **
    .nSNow = 50 && Max of t*i
    x = 1
    FOR t=0 TO 5
    FOR I=1 TO 10
    cI = ALLTRIM(STR((t*10)+I))
    .ADDOBJECT("greet&cI","LABEL")
    .greet&cI..AutoSize = .T.
    .greet&cI..BackStyle = 0
    .greet&cI..FontSize = ThisForm.nSnowFont
    .greet&cI..Caption = ThisForm.cSnow
    .greet&cI..Left = (i*50) + (10*rand())
    .greet&cI..Top = (t*90) + (10*rand())
    .greet&cI..Name = "greet&cI"
    .greet&cI..ForeColor = RGB(255,255,255)
    .greet&cI..Visible = .t.
    ENDFOR
    ENDFOR
    .ADDOBJECT("Timer1","Timer1")
    ENDWITH
    ENDPROC

    PROCEDURE KeyPress
    LPARAMETERS nKeyCode, nShiftAltCtrl
    IF nKeyCode = 27
    ThisForm.Release()
    ENDIF
    ENDPROC

    ENDDEFINE
    **********************************************
    DEFINE CLASS timer1 AS Timer
    Interval = 100
    Name = "Timer1"

    PROCEDURE Timer
    WITH ThisForm
    .Text2.forecolor = .Text1.ForeColor
    DO CASE
    CASE .Text1.forecolor=16711680
    .Text1.forecolor=255
    CASE .Text1.forecolor=255
    .Text1.forecolor=8421376
    CASE .Text1.forecolor=8421376
    .Text1.forecolor=8388863
    OTHERWISE
    .Text1.forecolor=16711680
    ENDCASE
    ENDWITH
    **
    FOR i= 1 TO ThisForm.nSnow
    zm_g='thisform.greet'+alltrim(str(i))
    zm_gl=zm_g+'.left'
    IF &zm_gl<572
    &zm_gl=&zm_gl+10*rand()
    ELSE
    &zm_gl=1
    ENDIF
    zm_gl=zm_g+'.top'
    IF &zm_gl<392
    &zm_gl=&zm_gl+10*rand()
    ELSE
    &zm_gl=1
    ENDIF
    ENDFOR
    ENDPROC
    ENDDEFINE
    **********************************************
    ** EOF
    **********************************************

    آخرین ویرایش به وسیله mehran_337 : دوشنبه 09 مرداد 1385 در 23:28 عصر دلیل: این پست به دلیل تکراری بودن بطور خودکار ادغام شده است.

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •