473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Creating bmp file from VB.NET

I have a utility that captures a signature on a handheld device and stores
it as as string containing a series of points. I want to recreate this
signature as a bmp file using VB.NET code. To do this, I have created a
bitmap object using the following code
Dim bmpSignature as Bitmap
bmpSignature = New BitMap(240, 80)
and I then use the graphics object to replot the points on the new bitmap,
and save it using
bmpSignature.Save("C:\Signature.bmp")
If I look at the saved file in XP by right clicking and selecting Preview, I
can see the signature so the data looks OK. My problem is reading the file
in another application (specifically Crystal Reports XI, but Paint and Paint
Shop Pro cannot read it either) - I just see a black box of the right size.
After looking on the net, I have come to the (possibly incorrect) conclusion
that something is wrong in the header of the file that is causing these
programs not to be able to read it. I have a VB6 utility to read the header
of a bmp file, the file that my VB app has saved doesn't appear to contain
sensible values in any of the fields. Does the Save method of the VB bitmap
object create a file with a header, and if not how can I create one and then
add my data to the end of it? Most sample code that I have seen of this type
is in C++, and I am not much of a C++ programmer, so any help on how to do
this in VB.NET would be appreciated. Thanks in advance.
Jan 12 '07 #1
3 3652
Andy,

Crystal Reports has a nasty habit of requiring a particular bit depth in the
..bmp's it can display. You MUST save the .bmp as a 24-bit .bmp for Crystal
Reports to display it properly.

"Andy Baker" <ab****@NOSPAMvanputer.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
If I look at the saved file in XP by right clicking and selecting Preview,
I can see the signature so the data looks OK. My problem is reading the
file in another application (specifically Crystal Reports XI, but Paint
and Paint Shop Pro cannot read it either) - I just see a black box of the
right size. After looking on the net, I have come to the (possibly
incorrect) conclusion that something is wrong in the header of the file
that is causing these programs not to be able to read it. I have a VB6
utility to read the header of a bmp file, the file that my VB app has
saved doesn't appear to contain sensible values in any of the fields. Does
the Save method of the VB bitmap object create a file with a header, and
if not how can I create one and then add my data to the end of it? Most
sample code that I have seen of this type is in C++, and I am not much of
a C++ programmer, so any help on how to do this in VB.NET would be
appreciated. Thanks in advance.


Jan 14 '07 #2
Hi Bruce

Thanks for that. I have solved it by creating an empty 24-bit ,bmp in Paint
Shop Pro, and writing my signature onto that. Crystal Reports now reads it
OK.

"Bruce W. Darby" <kr****@comcast.netwrote in message
news:Bd******************************@comcast.com. ..
Andy,

Crystal Reports has a nasty habit of requiring a particular bit depth in
the .bmp's it can display. You MUST save the .bmp as a 24-bit .bmp for
Crystal Reports to display it properly.

"Andy Baker" <ab****@NOSPAMvanputer.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
>If I look at the saved file in XP by right clicking and selecting
Preview, I can see the signature so the data looks OK. My problem is
reading the file in another application (specifically Crystal Reports XI,
but Paint and Paint Shop Pro cannot read it either) - I just see a black
box of the right size. After looking on the net, I have come to the
(possibly incorrect) conclusion that something is wrong in the header of
the file that is causing these programs not to be able to read it. I have
a VB6 utility to read the header of a bmp file, the file that my VB app
has saved doesn't appear to contain sensible values in any of the fields.
Does the Save method of the VB bitmap object create a file with a header,
and if not how can I create one and then add my data to the end of it?
Most sample code that I have seen of this type is in C++, and I am not
much of a C++ programmer, so any help on how to do this in VB.NET would
be appreciated. Thanks in advance.



Jan 15 '07 #3
You're most welcome, Andy :)

"Andy Baker" <ab****@NOSPAMvanputer.comwrote in message
news:45**********************@ptn-nntp-reader02.plus.net...
Hi Bruce

Thanks for that. I have solved it by creating an empty 24-bit ,bmp in
Paint Shop Pro, and writing my signature onto that. Crystal Reports now
reads it OK.

"Bruce W. Darby" <kr****@comcast.netwrote in message
news:Bd******************************@comcast.com. ..
>Andy,

Crystal Reports has a nasty habit of requiring a particular bit depth in
the .bmp's it can display. You MUST save the .bmp as a 24-bit .bmp for
Crystal Reports to display it properly.

Jan 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jeremy Langworthy | last post by:
Hi I am trying to create a MS Excel format CSV but I can't figure out how to get the line feed/carriage return/new record working properly. I am nding each line/record with these characters:...
1
by: Inpreet | last post by:
Hello I am using: ************************************************************************* header("Content-Type:application/force-download",false); header("Content-Disposition: attachment;...
1
by: dave | last post by:
I first started using HCW.exe to compile .rtf filew created with MS Word a couple of weeks ago. I used the file | new menu then selected New project in the dialog box and everything worked as...
1
by: C-man | last post by:
Basically I have this little program that will look through directories and rename any file it finds. The renaming that takes place is like removing of dashes or Caps the first letter from each...
2
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
1
by: MT | last post by:
We have a .NET dll that we are deploying to our customers using a deployment project in VS .NET 2003. There is a lot of information about creating publisher policies on the web, but we have not...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.