473,386 Members | 1,973 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,386 software developers and data experts.

How to specify bits/pixel and pixels/metre while saving image in vb6

Operating System: Windows 2000 Professional SP4
Language: Visual Basic 6 SP6

I have written the following program to draw a page to be used for answering multichoice quizzes. The bmp file is created with bitcount 24 and xPelsPerMeter = 0 and yPelsPerMeter = 0.

I want to create a monochrome image (bitcount =1) with specific PelsPerMeter (to get a 200 dpi image). I cannot find any properties of picturebox to specify these.

Please help. Thanks.

---------------------------------------------------------
Private Sub Command1_Click()
Dim x, y As Integer
Picture1.DrawWidth = 20
Picture1.PSet (40, 40)
Picture1.DrawWidth = 1
For y = 0 To 21
For x = 0 To 4
Picture1.Line (100 + 40 * x, 100 + 40 * y)-(120 + 40 * x, 120 + 40 * y), , B
Next x
Next y
Picture1.DrawWidth = 20
Picture1.PSet (750, 1080)
SavePicture Picture1.Image, "answers.bmp"
End
End Sub
-------------------------------------------------------
Jun 5 '10 #1
1 2342
vb5prgrmr
305 Expert 100+
Okay, with the save picture function you are only going to be able to save the image as a bitmap, and as such its pixels per inch is going to be dependent upon the monitor the image is displayed upon. Then its physical size will be dependent upon the size that you create it. Meaning, if you put a picture box on your form, set its and the forms scalemode to vbpixels and set its width to 204, you will be able to save a picture via the savepicture function that has a width of 200.

Now, since you are using Win2k Pro, you can use the Wang/Kodak imaging controls or WIA 2.0 (the thing that replaced those controls), GDI or GDI+, and a few other methods to save the picture created into various different methods.

Also, the savepicture function will save your picture as a 24 bit bmp.



Good Luck
Jun 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dev | last post by:
Dear Friends, I am passing the image name, size (in bytes) and imgaeformat (like jpg or bmp or pdf) through the network. I want display the image into picturebox without saving image...
6
by: illmatic | last post by:
Can someone post or give me a link to C# code that will allow me to save what is currently being shown in my CsGL control to disk? Any format will do, though bmp, jpg, or gif is preferred. ...
2
by: Peder Y | last post by:
My code is something like this: --------------- Image img = Image.FromFile("somefile.bmp"); FileStream fStream = new FileStream("someBinaryFile.dat"); BinaryWriter bw = new...
1
by: Pierre | last post by:
Hi... again (it's a bad day) Here is the point, I draw ellipse on an image (a map) in order to map something. But what I really don't know is how to erase the ellipse if I don't want to map the...
3
by: Neraph | last post by:
Sorry, I'm somewhat of a newbie at this. I'm looking for a method of grabbing the color of a pixel when clicking on an image (obviously, using javascript). Google searching hasn't returned...
4
by: Bruce | last post by:
I have an asp.net page that is dynamically building a table and populating cells with images (typically jpeg) and with associated metadata. How can the asp.net code efficiently determine the...
1
by: janaki112 | last post by:
my 1 dimensional pixel array is named => intensity (got by using pixel grabber) I have created an image using Code: Container n=new Container(); Image img=n.createImage(new...
10
by: eager | last post by:
Hello How am I able to aquire pixels from an image being in th vb.net environment? If possible make it with examples and functions of vb.net that i have to use. thank u for your corrporation.
4
vdraceil
by: vdraceil | last post by:
Hi,can anyone help me handling an image by pixels?..i want to control color of each pixel in that image-how am i supposed to do it??
1
Sl1ver
by: Sl1ver | last post by:
i've got this piece of coding. i need help with opening a picture box and then saving it as OLE Object in access DB How would i massage this code tho fit in? try { //save image to byte...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.