5
I have an application that sends photos, these photos are stored in the database (SQL Server) in a varchar(max) as a text. So far so good.
Now I need to convert all this text into Bitmap and show this image in an Image of Delphi (Delphi version 7)
Part of the "Text" image is something like this;
/9j/4AQSkZJRgABAQAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAGYATIDASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA Aaf9aqidaaqrbrihmuege1fhbyjxfdkbkaeii0kxwrvs0fakm2jyggkkfhcygroljicokso0nty3 Odk6q0rfrkdisuptvfvwv1hzwmnkzwznaglqc3r1dnd4exqdhiwgh4ijipktljwwl5izmqkjpkwm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vp09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx Bhjbuqdhcrmimoeifekrobhbcsmzuvavynlrchyknoel8rcygromjygpkju2nzg5okneruzhselk U1rvvldywvpjzgvmz2hpann0dxz3ehl6gooehyahiimkkpoulzaxmjmaoqokpaanqkmqsro0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD8gdIu bW4RWtrmCZSQwaKRHDMS+Avzbjnhhzmmdgybxdwuiyywstthi4iyx+8Dkk7W2+5HICEn5G0XUHs8 Pbko25rmpaac7hgx+Ydk2nbgcqqsxofunj8y6jgp+Pliowsg2kzby5zuigmdr7at/E3zsy2i9ltp X031atfnbrrtvpdte80e/wCfn3fl+Wt3d/Sdhgsvbi28qpbviz4i2ngmkrngdaxjiyhrrol8wwbw pbaS3DDJVeRjPHQnLkgivn7SvHtwgzMYWXPzD5VYksVIUEsdpPzL1A4O4AZr0HSfiDbA5khAAVs SAlWy2GbLEbgcZJ+UMWw2eDm4tN3etur7N2lo7P0V3a2qdkNNPZr+rrZu/2X/m938W/8FONE+0/B vwdrSrk6X4ztoPNwdyxX+m6nGwZyTzvgh+U8hdutnya/Nj9kv4nefpjj8qtd8gekbq/tseC9e1XR X0+VI5H1jT/srwCYFXMkIjMzvGuGfagDYBNfqj+3ZqreOfgXN4Z0Dw3retarPq2l6jA2nWbXUViN Pugad7jyizos0lyilervpmfp5gar81/2LNf074ZftFaBq/jm8HhjRodK8R2OqXOrLLYxwreaPeQ
This, the form the image is in is Base64. Using these functions, an error occurs in Delphi 7 in the variable declaration: Output: Tbytesstream, don’t know what use I use for this situation? : Tencoding.ASCII Thank you
– user11890
Does anyone have any more tips to solve this?
– user11890
TByteStream
comes from System.Classes or Classes depending on the version of Delphi http://docwiki.embarcadero.com/Libraries/XE6/en/System.Classes.TBytesStream already theTEnconding
comes from sysutils http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/SysUtils_TEncoding.html– Caputo
@user11890 Using the you use cited worked?
– Caputo