I have written my utility to convert old Win32 TChart templates into .NET format. So far I have one (as far as I know) outstanding issue. In Win32 brushes could have a pattern set to use an image, which was kind of default image (the extra selections on your left, like "zigzag"). I can save this image and reload it to .NET, but then it is treated as a real image, so my color selections are not applied. From other side, the .NET version does have all these selections available on the Hutch page, so if I only knew, which one was selected... So, here is my question: does anyone know, how to figure out if the image assigned to a brush is one of the TChart predefined ones, and if so - which one?
Help is greatly appreciated.
Converting brush images from old TChart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi UserLS,
I'm afraid this is not possible. TeeChart VCL serializes those images as binary data, for example:
You can get this data into a string and use something like code below to convert Base64 string into an image.
Hope this helps!
I'm afraid this is not possible. TeeChart VCL serializes those images as binary data, for example:
Code: Select all
Brush.Image.Data = {
07544269746D61707E000000424D7E000000000000003E000000280000001000
0000100000000100010000000000400000000000000000000000020000000200
000000000000FFFFFF007DF70000BAEB0000D75D0000EFBE00007DF70000BAEB
0000D75D0000EFBE00007DF70000BAEB0000D75D0000EFBE00007DF70000BAEB
0000D75D0000EFBE0000}
Code: Select all
byte[] brushData = System.Convert.FromBase64String(tmpStr);
System.IO.MemoryStream tmpStream = new System.IO.MemoryStream(brushData);
Bitmap bmp = (Bitmap)Bitmap.FromStream(tmpStream);
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |