Solved

Form1.PaintTo as region

Posted on 2006-07-22
1
179 Views
Last Modified: 2008-02-01
How can I get a function that will return the image just for a specified area from my form?

<b>I don't wish a function that will snap all form as GetFormImage and then to BitBlt in my bmp.</b>

I wish a function that will detect my controls from specified area and then to render these in my bmp. And as BONUS :) to skip (ignore) painting my vcl (TTest ) in the bmp if is in this area.
0
Comment
Question by:ginsonic
[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
1 Comment
 
LVL 10

Accepted Solution

by:
atul_parmar earned 500 total points
ID: 17199682
Try this!

var
  Bitmap: TBitmap;
  MySrc, MyDest: TRect;
begin
  MySrc := Rect(10,10,100,100);
  MyDest := Rect(0, 0, 100, 100);
  Bitmap := TBitmap.Create;
  Bitmap.Width := 100; Bitmap.Height := 100;
  Bitmap.Canvas.CopyRect(MyDest, Form1.GetFormImage.Canvas, MySrc);
  Bitmap.SaveToFile('c:\test.bmp');
  Bitmap.Free;
end;

Atul
0

Featured Post

Independent Software Vendors: 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

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…
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…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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