Home Home Archives About red box

Filed Under Delphi
digg Custom Form Modules
visits: 1563 | score: 4.7 
posted by sysrpl on Thursday January 27, 2011 2:47 AM

f 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.

This is my first programming video. Hopefully more will follow :)

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.

procedure UpdateAlphaWindow(Wnd: HWND; Image: TGraphic;
  Canvas: TCanvas; Opacity: Byte = $FF);
  Blend: TBlendFunction;
  Rect: TRect;
  P1, P2: TPoint;
  S: TSize;
  DC: HDC;
  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
    BlendOp := AC_SRC_OVER;
    BlendFlags := 0;
    SourceConstantAlpha := Opacity;
    AlphaFormat := AC_SRC_ALPHA;
  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);

print send topic Rate this article  

Well, everything looks fine but it would be much more useful to show how the underlaying code for the custom form templates looks like e.g. he header or overlay form rather then showing how to play with some graphics.

best regards
reply quote
blub said on Tuesday April 26, 2011 7:15 AM

This could be useful but I have not found source code to porbe. How do I get the source code?
reply quote
jose said on Tuesday July 26, 2011 5:00 PM

Where is the code ?

Fine but where is the code ?
reply quote
pedro said on Sunday September 25, 2011 8:51 AM


How do i download these form modules
reply quote
ShaunHirst said on Saturday April 7, 2012 3:36 AM

Where is download link?

where is it?
reply quote
hramenko said on Friday September 7, 2012 4:52 PM

Re: Where is download link?

yes i was also looking to down these but still no word from my post

maybe they have forgotten about this
reply quote
ShaunHirst said on Tuesday September 11, 2012 10:54 AM

where open source?
reply quote
zikimon said on Monday March 11, 2013 4:21 AM

pls upload component here.Help!
reply quote
zorerkek said on Thursday August 22, 2013 6:29 PM


how to create a form overlay as in the example of a custom project form modules. please give me the steps.
reply quote
guanming79 said on Tuesday September 3, 2013 1:15 AM

Source code

Please can you send me the source code
reply quote
zdenek.hanus said on Friday January 6, 2017 1:07 PM


image link indent align right align middle align left quote underline bold code quote

page generated in 1.719 seconds | last modified 2/06/2011 8:35 PM
none  none