Solved

Convert Hex value into a BMP Image in Visual Basic

Posted on 2004-04-13
3
1,510 Views
Last Modified: 2010-05-18
Hi ALL

Can any body give me a solution(a kind of wrapper function) on converting a hex value into a BMP image.

My actual problem is , I have a table in the database in which one column contains Hexadecimal value. I need to take that Hexadecimal value and convert it into a BitMap Image.

Example hexadecimal value looks like this:
00481C017FFFFF0000000000007FFFFF0000000000007FFFFF0000000000007FFFFF0000000000007FFFFF0000000000007FFFBE0000000000003FFEAE0000000000001DF4AE00000000000014E00200078000003C100002000483F80024100002007C824F80243F00F3F0C4F3CCF82461831B199C9FCCCFFCC0C60E09344CCCF9308068066924CCCCF890803806CD34CCCC9990803006E59CCCCC9990FFFFFC24C4CFCC99904CD8C4EC7CC8

0
Comment
Question by:sidduexpert
3 Comments
 
LVL 10

Accepted Solution

by:
Kavar earned 100 total points
ID: 10813335
its raw hex string....
create a file, write a character for each 2 letters represented in hex....

for i=0 to len(whatstring) step 2
char2=mid(whatstring,i,2)
toWrite= int(hex("&H" & char2)
print #1,char2 || outputfile.write char2
next

make sure you save the file as .bmp
you can then use LoadImage or whatever to view it, you could do it with pointers and RTLCopymemory, but this is way easier

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 94
firstswap challenge 20 83
Looking for a network enabled locker remotely controlled like Amazon locker 2 92
ejb message driven bean mdb creation steps 2 24
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

820 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