RBNUBE
2007-01-23 06:24:06 UTC
I'm storing FolderItems (images) in the CellTags of a ListBox. A save
function dumps the images out as BMP files based on these FolderItems.
Two odd things are happening:
1) The dimensions and resolutions of the images are not the same as the
originals. I would like for them to be the same, if possible.
For example:
A image with the properties of 5" x 5" at 72 PPI will end up being 192" x
192" at 1.875 PPI.
2) The original files do not have an alpha channel. The generated BMP
files all have an alpha channel. I don't want or need an alpha channel and
this extra channel is adding a considerable about of size to the file (380K
without alpha, 570K with alpha).
Here is my code. Any suggestions?
Thanks!
Dim testForFolderItem as Variant
testForFolderItem = clbCatsNItems.CellTag(i, 3)
If testForFolderItem isA FolderItem and testForFolderItem <> nil then
itemPic = FolderItem(testForFolderItem).OpenAsPicture
itemPicFile = deptPicFolder.Child(picNamePartNumer)
If itemPic <> nil then
// Save pic.
If itemPic <> nil and itemPicFile <> nil then
itemPicFile.SaveAsPicture(itemPic)
clbCatsNItems.CellTag(i, 3) = itemPicFile
Else
MsgBox "Could not process image file."
End If
End If
End If
RB5.5.5 and a mostly unused copy of 2006r2.
WinXP, 2.2 GHz, 2G RAM
function dumps the images out as BMP files based on these FolderItems.
Two odd things are happening:
1) The dimensions and resolutions of the images are not the same as the
originals. I would like for them to be the same, if possible.
For example:
A image with the properties of 5" x 5" at 72 PPI will end up being 192" x
192" at 1.875 PPI.
2) The original files do not have an alpha channel. The generated BMP
files all have an alpha channel. I don't want or need an alpha channel and
this extra channel is adding a considerable about of size to the file (380K
without alpha, 570K with alpha).
Here is my code. Any suggestions?
Thanks!
Dim testForFolderItem as Variant
testForFolderItem = clbCatsNItems.CellTag(i, 3)
If testForFolderItem isA FolderItem and testForFolderItem <> nil then
itemPic = FolderItem(testForFolderItem).OpenAsPicture
itemPicFile = deptPicFolder.Child(picNamePartNumer)
If itemPic <> nil then
// Save pic.
If itemPic <> nil and itemPicFile <> nil then
itemPicFile.SaveAsPicture(itemPic)
clbCatsNItems.CellTag(i, 3) = itemPicFile
Else
MsgBox "Could not process image file."
End If
End If
End If
RB5.5.5 and a mostly unused copy of 2006r2.
WinXP, 2.2 GHz, 2G RAM