Solved

Bitmap of non full visible components

Posted on 1998-10-13
11
229 Views
Last Modified: 2013-12-03
How can I make a bitmap of the full clientarea of a component when (a part of) the component is not visible.


0
Comment
Question by:Ronald Buster
  • 3
  • 3
  • 3
  • +2
11 Comments
 
LVL 1

Expert Comment

by:michaue
ID: 1342689
There is a application called SnagIt32 that does it for you ... You can set it up to AutoScroll when it takes it's input, and therefore it get the whole picture.  You can download a trail version from the web
0
 
LVL 1

Expert Comment

by:michaue
ID: 1342690
You can get it at http://www.techsmith.com/
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1342691
Don't get what ya wnat. Please clarify things so it's easier to understand what ya want! 10x

Regards,
Viktor Ivanov
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 3

Author Comment

by:Ronald Buster
ID: 1342692
Rejected because I need a bit of source in order to make it work into my program.

0
 
LVL 1

Expert Comment

by:michaue
ID: 1342693
Sorry, I thought it was for putting together a manual or something ...  Hope someone else will be able to help you ...

Elfrieda
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1342694
Some components can paint themselves into a specified device context when receiving a WM_PAINT message. Some not. You'll have to try it...

An extract from my win32 help file:

"An application sends the WM_PAINT message when Windows or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function.

WM_PAINT  
hdc = (HDC) wParam; // the device context to draw in
 

Parameters

hdc

Identifies the device context to draw in. If this parameter is NULL, use the default device context. This parameter is used by some common controls to enable drawing in a device context other than the default device context. Other windows can safely ignore this parameter."

Regards, Madshi.
0
 
LVL 2

Accepted Solution

by:
Thaddy earned 100 total points
ID: 1342695
For a simple answer i refer to my other one, here's some code that can do what you want.(Although this is a fragment) This is from my embeddable activeXfactory, so it's for ActiveX components, but you might rewrite it because it's really nothing more than pure pascal and api work.
Once you've got the metafi;le you can put it anywhere you like.
It takes the whole picture, not just the vsisble part.

Note that this is no job for beginners, you will get your feet wet...

procedure TCompoundDocActiveXControl.ScreenSnapShot;
  var
    hDC, RefDc : Windows.HDC;
    nY, nX : integer;
  begin

   with FwinControl do
        begin
        PerForm(WM_SETREDRAW, 0, 0);
        nY:= Height;
        nX:= Width;
        Height:= FcontrolSizeY;
        Width:= FcontrolSizeX;
        end;

    RefDC:= GetDC(0);
    hDC := CreateEnhMetaFile(RefDC, nil, nil, nil);
    SetMapMode(hDC, MM_ANISOTROPIC);

    FwinControl.PaintTo(hDC, 0, 0);
    FhMetaFile:= CloseEnhMetaFile(hDC);

    with Fwincontrol do
         begin
         Height:= nY;
         Width:= nX;
         PerForm(WM_SETREDRAW, 1, 0);
         end;

  end;

0
 
LVL 3

Author Comment

by:Ronald Buster
ID: 1342696
The answer is excellent but does it work on none wincontrol components I reward you with the 100 points for a excellent
answer

0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1342697
Alas, since you need a window handle, you can do this only with Twincontrols ( But almost anything usefull will be a Twincontrol descendant)
0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1342698
Alas, since you need a window handle, or rather a devicecontext handle (hDC), you can do this only with Twincontrols ( But almost anything usefull will be a Twincontrol descendant)
0
 
LVL 3

Author Comment

by:Ronald Buster
ID: 1342699
I need this in order to make a designer (a kind of form designer)

I thought I build this with bitmaps of controls, but I already
have another solution without bitmaps, just with the

perform(WM_SETREDRAW,1,0) the control doesn't get focus and the form receives all mouse clicks.

However since someone maybe has a better solution please let me know.


0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
font type, point size, readability questions 7 108
How to renew a Delphi rad-studio licence? 5 64
CheckListBox usage 3 58
Delphi: sending SMS on android platform 1 19
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question