Solved

Bitmap of non full visible components

Posted on 1998-10-13
11
226 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now