1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram

  5. Delphifan Magazine
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Custom Form Modules

Discussion in 'Delphi Programming' started by AdminDF, Jan 30, 2014.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan Staff Member DF Staff

    if you're interested in programming, you may want to view the video below. In it I describe how you can use image files to produce creative Windows forms. 


    Video Here

    For the curious, this is how how you can create the effect in your own projects. Just pass this procedure your window, and a graphic object with a canvas. For the best effect, make sure your graphic refers to a 32bit image.



    Code:
    [font=Verdana, Arial, Helvetica, sans-serif]procedure UpdateAlphaWindow(Wnd: HWND; Image: TGraphic;
    Canvas: TCanvas; Opacity: Byte = $FF);
    var
    Blend: TBlendFunction;
    Rect: TRect;
    P1, P2: TPoint;
    S: TSize;
    DC: HDC;
    begin
    if Image.Height = 0 then Exit;
    SetWindowLong(Wnd, GWL_EXSTYLE,
    GetWindowLong(Wnd, GWL_EXSTYLE) or WS_EX_LAYERED);
    GetWindowRect(Wnd, Rect);
    P1.X := Rect.Left;
    P1.Y := Rect.Top;
    with Blend do
    begin
    BlendOp := AC_SRC_OVER;
    BlendFlags := 0;
    SourceConstantAlpha := Opacity;
    AlphaFormat := AC_SRC_ALPHA;
    end;
    DC := GetDC(0);
    P2 := Point(0, 0);
    S.cx := Image.Width;
    S.cy := Image.Height;
    UpdateLayeredWindow(Wnd, DC, @P1, @S, Canvas.Handle,
    @P2, 0, @Blend, ULW_ALPHA);
    ReleaseDC(0, DC);
    end;[/font]
     
    vkarpets likes this.
  2. cpoutlook
    Offline

    cpoutlookcpoutlook is a Verified Member DF Member DF Payment Group

    Thanks.

     
     
  3. cyb0r
    Offline

    cyb0r DF Member

    cool thanks
     
  4. nnlscxlm
    Offline

    nnlscxlm DF Member

    Very nice! :)
    What is TOverlayForm?
     
  5. jimsweb
    Offline

    jimsweb DF Junior

    awesome tutorial - can we get the source that the guy in the video is using? The about box looks so professional.
     
  6. death_claws
    Offline

    death_claws DF Junior

    that is very nice like.
     
  7. jimsweb
    Offline

    jimsweb DF Junior

    it's very useful. thanks for sharing.
     

Share This Page