Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Saving Icon from canvas

Posted on 1998-12-12
2
Medium Priority
?
184 Views
Last Modified: 2010-05-18
Are there any way I can save a part of a canvas as an Icon ?
0
Comment
Question by:carceri
[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 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 400 total points
ID: 1350762
Look at CreateIcon and CreateIconIndirect. CreateIconIndirect will be better for what you want to do. Copy the part of the Canvas you want to make into an icon into a TBitmap and use the code below to create the icon.

var
  TheIcon : TIcon;
  IconInfo : TIconInfo;

begin
IconInfo.fIcon := True;
IconInfo.xHotSpot := 0;
IconInfo.yHotSpot := 0;
IconInfo.hbmMask := 0;
IconInfo.hbnColor := TheIconBitmap.Handle;

TheIcon := TIcon.Create;
TheIcon.Handle := CreateIconIndirect(IconInfo);
end;

Cheers,

Raymond.

0
 

Author Comment

by:carceri
ID: 1350763
Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

715 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