Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Form1.PaintTo as region

Posted on 2006-07-22
1
Medium Priority
?
183 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
1 Comment
 
LVL 10

Accepted Solution

by:
atul_parmar earned 1500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

772 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