Home Home Archives About red box
Username:
Password:
 
rss

Filed Under Delphi
digg Custom Form Modules
visits: 613 | 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);
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;


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
perm
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?
Thanks
reply quote
perm
jose said on Tuesday July 26, 2011 5:00 PM

Where is the code ?

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

Downloads

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

Where is download link?

where is it?
reply quote
perm
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
perm
ShaunHirst said on Tuesday September 11, 2012 10:54 AM

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

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

Help

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

Source code

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

Title:

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

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