Retrive image from image data
I am generating UI by mapping delphi form 2 java swing.
In delphi.dfm file for a picture some picture data is comming like this..
Picture.Data ={
07544269746D61704E310000424D4E3100000000000036040000280000009900
00004A0000000100080000000000182D00000000000000000000000100000001
0000FFFFFF000808080010101000181818002121210029292900313131003939
3900424242004A4A4A00525252005A5A5A00636363006B6B6B007B7B7B008484
84008C8C8C00949494009C9C9C00ADADAD00C6C6C600CECECE00D6D6D600DEDE
......
}
So suppose one picture is in the delphi form and i want to put that picture in my generated UI of java. how can i get the picture? is there any other way or i have to decode that picture.data and how? can any body help me?
thanks,
gantait
[862 byte] By [
debduttaa] at [2007-10-3 3:00:48]

Well, this sounds like an interesting problem.. so I'll pitch in... I'd say EXPIRIMENT!!!
What?
Well what I mean is...
- Make a picture of size 3 wide by 2 high
- use simple colors... 2 or 3 only
- look at the Picture.data value
- if you have a string with 3 sets of 2 characters then your format is probably RGB, if 4 sets of 2 chars then it could be ARGB.
Example:
P.d = {0000FF0000FF00FF00FF0000FF000000FF00}
view as...
P.d = {0000FF0000FF00FF00<next line>FF0000FF000000FF00}
That has 6 pixel colors...
If you know how many pixels you have (6) then you can split the array by an even increment... so 36 characters divided by 6 pixels. Now you have 6 characters per color. So color in this case represents an RGB value. R = red (first set of two) G = green (second set of two) B = blue (third set of two)
So just expiriment and find out the format thats being saved, tell me how it works out :)