Solved

Using ExtCreateRegion

Posted on 1998-11-23
2
1,166 Views
Last Modified: 2010-10-05
Hi.
I'm looking for simple example using ExtCreateRegion.
I don't know how to parse the rectangles to this functions.
3 rectangles will be enough to demonstrate this problem.
Thanx!
0
Comment
Question by:Aleq
[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
  • 2
2 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1347701
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1347702
Hi Aleq, I post this article from Borland's groups as an answer:
"...Here is some sample code (it is not optimized):

                        FRegion:=CreateRectRgn(0,0, 0,0);
                        try
                          for i:=0 to FBitmap.Height-1 do
                            begin
                              for j:=R.Left to R.Right-1 do
                                begin
                                  C:=FBitmap.Canvas.Pixels[j,i];
                                  if C<>TransColor then
                                    begin
                                      Rgn1:=CreateRectRgn(j-R.Left,i,succ(j-R.Left),succ(i));
                                      Rgn2:=CopyRgn(FRegion);
                                      CombineRgn(FRegion,Rgn2,Rgn1,RGN_OR);
                                      DeleteObject(Rgn1);
                                      DeleteObject(Rgn2)
                                    end
                                end
                            end
                        except
                          DeleteObject(FRegion);
                          FRegion:=0
                        end

                  Here is CopyRgn function:

                  function CopyRgn(Rgn:hRgn):hRgn;
                  var RData:PRgnData;
                         sz:integer;
                  begin
                    Result:=0;
                    if Rgn=0 then exit;
                    sz:=GetRegionData(Rgn,0,nil);
                    if sz=0 then exit;
                    GetMem(RData,sz);
                    try
                      GetRegionData(Rgn,sz,RData);
                      Result:=ExtCreateRegion(nil,sz,RData^);
                    finally
                      FreeMem(RData)
                    end;
                  end;
."
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

733 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