Solved

Convert Hex value into a BMP Image in Visual Basic

Posted on 2004-04-13
3
1,469 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
This article will show, step by step, how to integrate R code into a R Sweave document
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now