Can I take over loading a .ico file by implementing a TGraphic decendentand register it with TPicture.RegisterFileFormat?

Can I take over loading a .ico file by implementing a TGraphic decendentand register it with TPicture.RegisterFileFormat?

Post by David Ninn » Sat, 09 Jun 2007 09:15:30



Hi Edwin,

It's not too hard - create a TGraphic class that can read the format you
wish and then register it with TPicture.

To register a new icon class call

TPicture.RegisterFileFormat('.ico', 'My new icon class', TVistaIcon);

To create a vista icon class probably the best way is to descend from
TIcon so

TVistaIcon = class(TICon)

...
end;

in the TVistaIcon you may only have to override the Draw function to do
what you want, you may have to fiddle with other methods.

hth,
Dave
 
 
 

1. Why does Form-A's instance fire Form-B's event??

2. Copy all data from a:Class A's fields to the namesake fields of b:Class B.

I have two class with nearly exactly same attributes, the only difference is
class B's property setter does some argument checking.

[Serializable]
class A
{
private string a;

public string AA
{
get { return a; }
set { a = value; }
}
}

[Serializable]
class B
{
private string a;

public string AA
{
get { return a; }
set
{
if (string.IsNullOrEmpty(value))
{
throw new ApplicationException();
}
a = value;
}
}
}

I want to do the following:
A a = new A();
a.AA = "123123";
B b = (B)a; -- Copy a's attribute values to b.
Please tell me how to implement a generic function to support copying
namesake fields from one class instance to another even when they belongs to
different class type.

Thanks.

zlf

3. Capture image of App#A's window from App#B

4. equation that will filter out #N/A's

5. Quick A's to easy(?) Q's appreciated...

6. how to conver #n/a's to 0

7. #n/a's

8. "Matching" column A's values in column B

9. how to hide #N/A's?

10. best way to sum a column with #N/a's?

11. 'Send As' messages stay in User A's sent folder.

12. CAnnot type lowercAse 'A's Anymore (solved!)

13. Summing a Range With N/A's

14. Summing N/A's

15. Finding the Value (of text and numbers) between N/A's