Solved

Form1.PaintTo as region

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

Industry Leaders: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

628 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