Link to home
Start Free TrialLog in
Avatar of wilmsoft

asked on

Create a Bitmap w/600 DPI

I need to create a brand new bitmap, copy in some other images to create a larger image.
but, it makes it only 120 DPI. The orginal images were 600 DPI.

I have seen code to CHANGE a files DPI but, I don't have a file the bit map is in memory!?
Avatar of MerijnB
Flag of Netherlands image

Do you write the new (600 dpi) bitmap to disk? If yes, why don't you change the dpi afterwards (after you've written it to disk)
as far a I know, the bit map only contains xpixel and xpixel and colordepth as a property, the DPI you have to negotiate with your printing device, means screen or printer
can you post a bit more to understand your problem?
sorry only in german >
Bitmaps do actually contain information about DPI, but of course you're right, if you only display it on screen there is no real use for it.
if you know the size of your display in inches you can calculate the needed size for your bitmap ....
or see
BTW >  rescaling of bitmaps (increase) it is no real solution, as you do not add real information to your bitmap
A few questions, I'm not sure I understand the question fully.

- You want your bmp to be 600 dpi or 120 dpi?
- What are you using your in memory bitmap for?
Avatar of wilmsoft


The orginals are in 600 DPI.
I have 24 separate 600 DPI JPG images. I have to create ONE image from the separate images. I then send that image to a printer (it is capable of 2400 DPI).
So, this image is created in a JPGImage with is only in memory (IE never scaled down to the screen resolution) However, by default (I'm guessing) when you 'create' the JPGimage, it's DPI is only 120.
I have found many examples that will read in an Image from file, change the header information of the file and that will change the DPI. In my case there is never a file as I'm going from the 'canvas' of the memory JPGImage to the 'canvas' of the printer.
Speed is an issues so, I was trying to avoid writing a file, changing the file DPI, reading the file in to memory just to change the DPI.
ok, the big question now is do you have to change the dpi at all?
DPI is only how you interpret the pixels related to physical size (inches).

What goes wrong if you make the image in memory, don't think about the DPI at all, and sent it to the printer?

One more thing, you were talking about BMP before, but about JPG now, which one is it?
convert bmp tp jpg -> i can provide code
stitch the image with your own delphi application  , need a image stitching algo ?
if not use the bitblt function from the WINDOWS API
single task >  use paint shop pro
don't take care on the DPI, pixel size and colort depth is the real image quality factor
pixel size?
@ MerijnB:  I work with virtual images at 500.000 * 500.000 pixel, image size on the HD ~ 30 Gbyte
shrink stretch,  ....   you can do, the real information is in the pixels, not in the dpi, this is my poor printer or screen
"One more thing, you were talking about BMP before, but about JPG now, which one is it?"
I said Bitmap... not BMP... Bitmap as in NOT vector information. As in a file that has information about dots that will make up an image. JPG, BMP, PNG, GIF all are Bitmaps. EPS, PS, PDF are all vector information (like lineto, moveto)
"don't take care on the DPI, pixel size"
Pixel size is a function of Dots per inch. If you have 3 DPI the thinnest line you could draw would be 1/3 of an inch. If I had a line that was drawn at 300 dpi, the smallest "PIXEL SIZE" could be 1/300 of an inch. but, not in the 3 DPI image, it would still be 1/3 of an inch. This is where you see all the little "jags" on a diagonal line.
"What goes wrong if you make the image in memory, don't think about the DPI at all, and sent it to the printer?"
I am doing that, and the image is again, 120 DPI by default. so, my nice 1/600 inch line is now 5 times fatter. and we are printing on a 1200 DPI printer where can see the "jaggies"

nr. of pixels =  dot/inch_hardware  *  size_hardware_inches
post a bit more detaild on your problem--code
assume you loose resolution while reading the data source or use the wrong stitching/printing and again loose resolution
you can create the jags with ervery datasource, see sample ....

Avatar of wilmsoft

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial