Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bitmap of non full visible components

Posted on 1998-10-13
11
Medium Priority
?
235 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
[X]
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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

688 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