Solved

Form1.PaintTo as region

Posted on 2006-07-22
1
175 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

911 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

15 Experts available now in Live!

Get 1:1 Help Now