Solved

copying part of an image?

Posted on 1997-09-05
8
142 Views
Last Modified: 2010-04-04
I am trying to copy part of an image from image1 component to image2. (bitmap to bitmap) I should be able to copy lets say point(25,25) to point(100,100) from image1 to image2, shouldn't I? Especially if it is an even square which I am trying to copy? (I am not trying to overlay the same points in image2, but trying to make image2 contain the portion of image1).  I also read here one other time an easy way to flip an image upside down, but of course, I didn't save that information.  Anyone know the solution to these?  
                   Thanks
0
Comment
Question by:jexd99
[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
  • 4
  • 2
  • 2
8 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 70 total points
ID: 1343925
Hi jexd99,

Solution 1 :

But a button on a form and 3 images. Put in image1 an image, compile it. Push the button and I think that what you see then is what you need.

procedure TForm1.Button1Click(Sender: TObject);
var Rectangle : TRect;
begin
 Rectangle := Rect(10,10,500,500);
 Image2.Canvas.CopyRect(Rectangle,Image1.Picture.Bitmap.Canvas,Image1.BoundsRect);
 Image3.Canvas.CopyRect(Rectangle,Image1.Picture.Bitmap.Canvas,Rectangle);
end;

Solution 2:

 a) You can look at previous asked question

 b) get a freeware component which does all this and something more :

 http://intermid.com/delphi/download/fancyimg.zip

have fun,
c.u. ZifNab;
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1343926
In Delphi3 when You copy 256color image in this way then in result you get 16color copied image not 256! In Delphi1 and 2 all works fine.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1343927
Hi mirek!

Also browsing around? Thanks again for giving that comment. I don't have D3 so I don't know if it works in D3. Why doesn't it works in D3.


0
Technology Partners: 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!

 
LVL 3

Expert Comment

by:mirek071497
ID: 1343928
ZifNab - Because VCL was changed and you must operate on Palette.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1343929
mirek - 10x
0
 

Author Comment

by:jexd99
ID: 1343930
Thanks.. unfortunately, I have D3.... sometimes I not sure why
I ever upgraded. :)
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1343931
If you have D3, why didn't you reject my answer???

0
 

Author Comment

by:jexd99
ID: 1343932
I should have explained better in the original question I guess (that I was using D3), so as far as the question I asked goes, I got the answer. I will research the "palette" stuff to find out what I need to do, but at least I know where to go from here :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reconfigure Delphi Install? 2 65
creating threads in delphi 1 158
Find and Replace Stream with 0s 8 71
Can Live bindings change TGrid Cell Colour ? 1 29
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

763 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