Solved

Convert Hex value into a BMP Image in Visual Basic

Posted on 2004-04-13
3
1,543 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.

734 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