473,840 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Images

EdB
We are having an odd problem saving images. We capture customer signatures
on a Palm Pilot and save them as points on a graph. We are able to
reconstruct these points to display the signature, but when we attempt to
save the file off so that we can pass it back to our customers we get an odd
result. If we try to view the file using Windows Picture and Fax viewer,
everything's ok. But try to view it using any other graphics program (such
as Paint or even as thumbnails in Windows Explorer) and we get nothing but a
black box. I have another app (JASC Image Commander) that tells me that the
file is not a valid JPG or BMP file (we tried both). Here's a sample of the
code.

SignatureManage r is a DLL that is used to plot the points and reconstruct
the image. As I said, it displays just fine in the Picture Box on the form.

Dim SigMan As ASTSignature.Si gnatureManager
picSignature.Si zeMode = PictureBoxSizeM ode.StretchImag e

Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelFo rmat.Format32bp pArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)),
Bitmap)

picSignature.Im age = imgSignature
picSignature.Cl ientSize = New Size(208, 72)

imgSignature.Sa ve(sFileName)

Anyone have any thoughts?

Nov 21 '05 #1
14 1455
Hi, EdB,

When you save, you should specify what format you are going to save
to....

imgSignature.Sa ve(sFileName, System.Drawing. Imaging.ImageFo rmat.jpeg)
or
imgSignature.Sa ve(sFileName, System.Drawing. Imaging.ImageFo rmat.bmp)

then see if you can open it.

HTH,
Barry

On Sun, 29 May 2005 19:08:03 -0700, EdB
<Ed*@discussion s.microsoft.com > wrote:
We are having an odd problem saving images. We capture customer signatures
on a Palm Pilot and save them as points on a graph. We are able to
reconstruct these points to display the signature, but when we attempt to
save the file off so that we can pass it back to our customers we get an odd
result. If we try to view the file using Windows Picture and Fax viewer,
everything's ok. But try to view it using any other graphics program (such
as Paint or even as thumbnails in Windows Explorer) and we get nothing but a
black box. I have another app (JASC Image Commander) that tells me that the
file is not a valid JPG or BMP file (we tried both). Here's a sample of the
code.

SignatureManag er is a DLL that is used to plot the points and reconstruct
the image. As I said, it displays just fine in the Picture Box on the form.

Dim SigMan As ASTSignature.Si gnatureManager
picSignature.Si zeMode = PictureBoxSizeM ode.StretchImag e

Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelF ormat.Format32b ppArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)),
Bitmap)

picSignature.Im age = imgSignature
picSignature.Cl ientSize = New Size(208, 72)

imgSignature.Sa ve(sFileName)

Anyone have any thoughts?


bceggersATcomca stDOTnet
Nov 21 '05 #2
EdB
Thanks, but that did not make a difference. I had had that in there, put it
back as you suggested and it didn't help. Infact, now even the Windows
Picture and Fax Viewer doesn't recognize it.

"Barry" wrote:
Hi, EdB,

When you save, you should specify what format you are going to save
to....

imgSignature.Sa ve(sFileName, System.Drawing. Imaging.ImageFo rmat.jpeg)
or
imgSignature.Sa ve(sFileName, System.Drawing. Imaging.ImageFo rmat.bmp)

then see if you can open it.

HTH,
Barry

On Sun, 29 May 2005 19:08:03 -0700, EdB
<Ed*@discussion s.microsoft.com > wrote:
We are having an odd problem saving images. We capture customer signatures
on a Palm Pilot and save them as points on a graph. We are able to
reconstruct these points to display the signature, but when we attempt to
save the file off so that we can pass it back to our customers we get an odd
result. If we try to view the file using Windows Picture and Fax viewer,
everything's ok. But try to view it using any other graphics program (such
as Paint or even as thumbnails in Windows Explorer) and we get nothing but a
black box. I have another app (JASC Image Commander) that tells me that the
file is not a valid JPG or BMP file (we tried both). Here's a sample of the
code.

SignatureManag er is a DLL that is used to plot the points and reconstruct
the image. As I said, it displays just fine in the Picture Box on the form.

Dim SigMan As ASTSignature.Si gnatureManager
picSignature.Si zeMode = PictureBoxSizeM ode.StretchImag e

Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelF ormat.Format32b ppArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)),
Bitmap)

picSignature.Im age = imgSignature
picSignature.Cl ientSize = New Size(208, 72)

imgSignature.Sa ve(sFileName)

Anyone have any thoughts?


bceggersATcomca stDOTnet

Nov 21 '05 #3
EdB,

I would look in the encoding class, every sample about it on MSDN is almost
in C# in my opininon is not that clear as I would like it. Can be that I
know nothing or less about graphics on a computer.

http://msdn.microsoft.com/library/de...classtopic.asp

Otherwise maybe these pages

Http://www.bobpowell.net/
Cor
Nov 21 '05 #4

"EdB" <Ed*@discussion s.microsoft.com > wrote
We are having an odd problem saving images. Dim imgSignature As New System.Drawing. Bitmap(320, 138, Imaging.PixelFo rmat.Format32bp pArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)), Bitmap)

picSignature.Im age = imgSignature

Anyone have any thoughts?

It seems a bit strange that you would create a bitmap, asign it to a variable, and
then assign a different bitmap to that same variable. I would have thought that
section should look more like:

Dim imgSignature As Bitmap = CType(SigMan.Ge tSignature(CStr (iDSID)), Bitmap)
picSignature.Im age = imgSignature.Cl one
None the less, see if using the Clone method will help....

LFS

Nov 21 '05 #5
When creating a new 32bpp image the default values in the pixel array are
transparent black. This is interpreted in the picturebox as fully
transparent so you're probably seeing the signature just fine because its
projected over the back-colour of the picturebox. When this is saved all the
image transparency will be lost unless you save to PNG so you'll just see
what is apparently a black image..

Try setting the bitmap to white when you create it like this:
Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelFo rmat.Format32bp pArgb)
Dim g as Graphics.FromIm age(imgSignatur e)
g.Clear(Color.W hite)
g.Dispose()

'continue with the rest of your stuff here...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"EdB" <Ed*@discussion s.microsoft.com > wrote in message
news:2E******** *************** ***********@mic rosoft.com...
We are having an odd problem saving images. We capture customer
signatures
on a Palm Pilot and save them as points on a graph. We are able to
reconstruct these points to display the signature, but when we attempt to
save the file off so that we can pass it back to our customers we get an
odd
result. If we try to view the file using Windows Picture and Fax viewer,
everything's ok. But try to view it using any other graphics program
(such
as Paint or even as thumbnails in Windows Explorer) and we get nothing but
a
black box. I have another app (JASC Image Commander) that tells me that
the
file is not a valid JPG or BMP file (we tried both). Here's a sample of
the
code.

SignatureManage r is a DLL that is used to plot the points and reconstruct
the image. As I said, it displays just fine in the Picture Box on the
form.

Dim SigMan As ASTSignature.Si gnatureManager
picSignature.Si zeMode = PictureBoxSizeM ode.StretchImag e

Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelFo rmat.Format32bp pArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)),
Bitmap)

picSignature.Im age = imgSignature
picSignature.Cl ientSize = New Size(208, 72)

imgSignature.Sa ve(sFileName)

Anyone have any thoughts?

Nov 21 '05 #6
EdB
Larry,

Thanks for the reply, but I still get "Invalid Bitmap" on the resulting files.

"Larry Serflaten" wrote:

"EdB" <Ed*@discussion s.microsoft.com > wrote
We are having an odd problem saving images.

Dim imgSignature As New System.Drawing. Bitmap(320, 138, Imaging.PixelFo rmat.Format32bp pArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)), Bitmap)

picSignature.Im age = imgSignature

Anyone have any thoughts?

It seems a bit strange that you would create a bitmap, asign it to a variable, and
then assign a different bitmap to that same variable. I would have thought that
section should look more like:

Dim imgSignature As Bitmap = CType(SigMan.Ge tSignature(CStr (iDSID)), Bitmap)
picSignature.Im age = imgSignature.Cl one
None the less, see if using the Clone method will help....

LFS

Nov 21 '05 #7
EdB
Bob,

Thanks for the response.

When I tried this I got a compile error on this line:

Dim g as Graphics.FromIm age(imgSignatur e)

The error says:

Array Bounds Cannot Appear In Type Specifiers
"Bob Powell [MVP]" wrote:
When creating a new 32bpp image the default values in the pixel array are
transparent black. This is interpreted in the picturebox as fully
transparent so you're probably seeing the signature just fine because its
projected over the back-colour of the picturebox. When this is saved all the
image transparency will be lost unless you save to PNG so you'll just see
what is apparently a black image..

Try setting the bitmap to white when you create it like this:
Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelFo rmat.Format32bp pArgb)
Dim g as Graphics.FromIm age(imgSignatur e)
g.Clear(Color.W hite)
g.Dispose()

'continue with the rest of your stuff here...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"EdB" <Ed*@discussion s.microsoft.com > wrote in message
news:2E******** *************** ***********@mic rosoft.com...
We are having an odd problem saving images. We capture customer
signatures
on a Palm Pilot and save them as points on a graph. We are able to
reconstruct these points to display the signature, but when we attempt to
save the file off so that we can pass it back to our customers we get an
odd
result. If we try to view the file using Windows Picture and Fax viewer,
everything's ok. But try to view it using any other graphics program
(such
as Paint or even as thumbnails in Windows Explorer) and we get nothing but
a
black box. I have another app (JASC Image Commander) that tells me that
the
file is not a valid JPG or BMP file (we tried both). Here's a sample of
the
code.

SignatureManage r is a DLL that is used to plot the points and reconstruct
the image. As I said, it displays just fine in the Picture Box on the
form.

Dim SigMan As ASTSignature.Si gnatureManager
picSignature.Si zeMode = PictureBoxSizeM ode.StretchImag e

Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelFo rmat.Format32bp pArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)),
Bitmap)

picSignature.Im age = imgSignature
picSignature.Cl ientSize = New Size(208, 72)

imgSignature.Sa ve(sFileName)

Anyone have any thoughts?


Nov 21 '05 #8

"EdB" <Ed*@discussion s.microsoft.com > wrote
Larry,

Thanks for the reply, but I still get "Invalid Bitmap" on the resulting files.


If you've tried declaring the format when you save, and you've tried using
a clone, I'd suggest the next thing is to try to copy the image from your
picturebox to another bitmap.

If you can copy it to another bitmap, you certainly should be able to save it.

Something is amiss, unfortunately you are the one who has to find it... :-P

LFS
Nov 21 '05 #9
EdB
I figured this out. This

Dim g as Graphics.FromIm age(imgSignatur e)

needs to be

Dim g as Graphics = Graphics.FromIm age(imgSignatur e)

But still, no joy.

"EdB" wrote:
Bob,

Thanks for the response.

When I tried this I got a compile error on this line:

Dim g as Graphics.FromIm age(imgSignatur e)

The error says:

Array Bounds Cannot Appear In Type Specifiers
"Bob Powell [MVP]" wrote:
When creating a new 32bpp image the default values in the pixel array are
transparent black. This is interpreted in the picturebox as fully
transparent so you're probably seeing the signature just fine because its
projected over the back-colour of the picturebox. When this is saved all the
image transparency will be lost unless you save to PNG so you'll just see
what is apparently a black image..

Try setting the bitmap to white when you create it like this:
Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelFo rmat.Format32bp pArgb)
Dim g as Graphics.FromIm age(imgSignatur e)
g.Clear(Color.W hite)
g.Dispose()

'continue with the rest of your stuff here...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"EdB" <Ed*@discussion s.microsoft.com > wrote in message
news:2E******** *************** ***********@mic rosoft.com...
We are having an odd problem saving images. We capture customer
signatures
on a Palm Pilot and save them as points on a graph. We are able to
reconstruct these points to display the signature, but when we attempt to
save the file off so that we can pass it back to our customers we get an
odd
result. If we try to view the file using Windows Picture and Fax viewer,
everything's ok. But try to view it using any other graphics program
(such
as Paint or even as thumbnails in Windows Explorer) and we get nothing but
a
black box. I have another app (JASC Image Commander) that tells me that
the
file is not a valid JPG or BMP file (we tried both). Here's a sample of
the
code.

SignatureManage r is a DLL that is used to plot the points and reconstruct
the image. As I said, it displays just fine in the Picture Box on the
form.

Dim SigMan As ASTSignature.Si gnatureManager
picSignature.Si zeMode = PictureBoxSizeM ode.StretchImag e

Dim imgSignature As New System.Drawing. Bitmap(320, 138,
Imaging.PixelFo rmat.Format32bp pArgb)
imgSignature = CType(SigMan.Ge tSignature(CStr (iDSID)),
Bitmap)

picSignature.Im age = imgSignature
picSignature.Cl ientSize = New Size(208, 72)

imgSignature.Sa ve(sFileName)

Anyone have any thoughts?


Nov 21 '05 #10

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

Similar topics

7
2371
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some patch updating worked fine and showed the pictures. Now the pictures no longer show when looking at the source code the absolute path of the file is correct but will not display the image. I tried it on another 2000 adv svr and the script worked...
3
3833
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a nutshell when testing my ASP.NET (localhost) apps images randomly don't load on the page. Examining the IIS logfile shows the missing images give 401 or 403 errors. Here's an example - 10:15:47 127.0.0.1 GET...
10
2373
by: Neo Geshel | last post by:
I am seeking to hand-roll my own blog in ASP.NET 2.0 and SQLExpress 2005. Why? Because I can. Because I will gain experience. The one thing that has me stumped at square one is inline images. That is, images inline with the actual content of the blog itself. Is there an example that I can be pointed to, where I can examine some code and figure out how to do this? Frankly I haven't got a clue, aside from breaking the content up into...
6
4607
by: wattanabi | last post by:
Greetings, I'm attempting to layout a bunch of images in a grid using DIV's instead of a table. I currently have a 3x6 table that I need to convert to css. I've seen various example of a 3 to 4 column layout. Is this the only way to accomplish this? To see the table in its current format, please go here: http://www.godofmod.com
2
3805
by: mouseit101 | last post by:
Hi, I'm writing a script that would (hopefully) search google images for whatever, and then return a list of URLs for the image. Right now I have: $dom = new DomDocument(); $url = "http://images.google.com/images?q=hello"; $dom->loadHTMLFile($url);
0
1840
by: Frenchie | last post by:
Hi, I have created a very neet menu from an example found on the MSDN library at: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitembinding.imageurlfield.aspx My ASP:MENU uses images to create the buttons. Unfortunately, I can't get the buttons to link to pages. Also I can't remove the "sitemap" from the left of my menu.
1
1405
by: Cerebral Believer | last post by:
Hi folks, I am using the following code for mouse over (roll-overs) in my XHTML code. <a onmouseover="document.getElementById('sitemap').src = '../images/buttons/sitemap_mo.jpg';" onmouseout="document.getElementById('sitemap').src = '../images/buttons/sitemap.jpg';" href="../sitemap.htm" border="0"> <img id='sitemap' src="../images/buttons/sitemap.jpg" border="0" alt="Site
4
2975
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in theory you could get the same image 4 times. I quite often get 2 of the same picture come up. What's the easiest way of saying "once an image is assigned to a variable, take it out of the array"? Here's my code so far.. images = new Array(34);...
5
4123
by: remon87 | last post by:
I need some help. I have javasript that creates the submenu but it works if I have a text with css. I need it to do the same with a roll over images. so when I click on the image the submenu (images) shows with roll overs as well. That's what I have... <script type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; }
0
9699
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10601
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10658
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10300
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7838
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5685
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4072
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.