Click here to Skip to main content
13,548,587 members
Rate this:
Please Sign up or sign in to vote.
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)

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:

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

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 15-Nov-12 12:14pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04-2016 | 2.8.180515.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100