Solved

Form1.PaintTo as region

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

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.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi XE2 application frozen on Windows 10 10 231
delphi exception 7 58
select query - oracle 16 82
Create a path if not exists 7 47
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

10 Experts available now in Live!

Get 1:1 Help Now