Click here to Skip to main content
15,884,050 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys,
i have a problem with my project
in this momment im trying to save a bitmap with this syntax
the app is in VB.NET (VS 2010)

VB.NET
Private Function getImage(rect As Rectangle, penWidth As Integer)
Dim bitmap As New Bitmap(rect.Width, rect.Height)
Dim brush As New SolidBrush(Color.White)
Dim graphics As Graphics
graphics = graphics.FromImage(bitmap)
graphics.FillRectangle(brush, 0, 0, rect.Width, rect.Height)


Then i save the bitmap:

VB.NET
bitmap.Save(saveLocation, Imaging.ImageFormat.bmp)


then in other Application developed in VB 6.0

i trying to generate a Report with the image Saved.

i use this syntax in the VB 6.0 App

VB.NET
Printer.paintPicture LoadPicture(Savedlocation,....)


then is in the line shown above when the Error:
"Invalid Pucture"
i think . is a problem with the Bits of Bitmap... i think

thanks por the help
regards from Mexico
Posted

1 solution

Does Paint open the image ? Is it named .bmp ? Why would you use VB6 at all ? The Bitmap constructor is where you specify a bit depth for your image.
 
Share this answer
 
Comments
Rene Bustos 16-Nov-12 10:25am    
Thanks for Answer Christian Graus.
1)Yes, when i do right click an open woth PAINT, this open the image correct.
2)Yes, when i used this sintax bitmap.Save(saveLocation, Imaging.ImageFormat.bmp) , the image is saved in BMP format
3)well, in our company we have an application that was made in VB 6.0. this app has a lot of modules.. so.. is hard to migrate to .NET, that system has 8 years. and the Tablet only has a .NET SDK.
4)Yes it is, but i dont understand yet. how can i know if the image created is 8 bits , 16 bits 32, bits... because.. in the VB 6.0 app.. it appear that only supports 8 bits image in format BMP and WMF.

i trying to create a image in PNG format to.. because i need a background with transparency... for the signature.
Thanks in advance
Christian Graus 16-Nov-12 10:35am    
There's a bitmap constructor that takes a bit depth, that's how you specify the bit depth of the image.
Rene Bustos 16-Nov-12 10:54am    
ok.. let me check that option. thanks Chistian
regards from Mexico

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900