Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Bitmap of non full visible components

Posted on 1998-10-13
11
230 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

792 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