How can I Load image from Centura - oracle-sqldeveloper

How can I Load an image.Jpg using Centura?
then display it in Centura and be able to load this image as a logo in the qrp reports?

For loading the image into a centura image control by setting its property as shown in the below image.
In addition to this you can also load the image pragmatically using any of the below mentioned Sal functions,
1.SalPicSetImage
bOk = SalPicSetImage ( hWndPict, strImageBytes, nType )
Inserts the contents of a string to a picture object. The third parameter is a constant.
Parameters
hWndPict Window handle. The handle (or name) of a picture.
strImageBytes String. String buffer which stores the image bytes.
nType Number. The format of the picture contents:.Example for jpg - PIC_ImageTypJPEG
2.SalPicSetFile
bOk = SalPicSetFile ( hWndPict, strFileName )
Inserts a file's contents into a picture.
Parameters
hWndPict Window Handle. The handle (or name) of a picture.
strFileName String. The name of the file whose contents are to be inserted into hWndPict.
Steps for passing an image into Qrp
1.Declare an Object in the qrp file, as shown in the below image
2.Assign the above mentioned object to Qrp picture as shown the image below,
3.Set the above mentioned object in the output list.(in centura application)
4.Assign centura image contents into a longstring variable and set it in Input list.(In centura application)
For copying centura image contents into string variable you can use SalPicGetString().

Related

How to manipulate all pages in a multi-page tiff image without converting it into list of single images in Pillow?

I would like to insert a small image to each page in a multi-page tiff using Pillow.
But this fails:
from PIL import Image, ImageSequence
stack = Image.open(r"D:\pillow_temp\stack_example.tif") # opens an rgb multi tiff
insert= Image.open("D:\pillow_temp\insert.tif") # opens a single page rgb multi tiff
for page in ImageSequence.Iterator(stack):
page.paste(insert,(0,0))
stack.save(r"D:\pillow_temp\out_fails.tif", format="TIFF", save_all=True)
Transforming the multi-page tiff to a list and saving one changed image first followed by appending the rest of the images works but doesn't feel proper.
pages= []
for page in ImageSequence.Iterator(stack):
page = page.copy()
page.paste(insert,(0,0))
pages.append(page)
pages[0].save(r"D:\pillow_temp\out_works.tif", format="TIFF", save_all=True, append_images=pages[1:])
Is there a way to manipulate the pages directly in the PIL.TiffImagePlugin.TiffImageFile object and call im.save("filename.tiff", format="TIFF", save_all=True) directly?
All help is appreciated.
https://pillow.readthedocs.io/en/stable/reference/ImageSequence.html?highlight=multi%20tiff%20iterator#the-iterator-class
https://pillow.readthedocs.io/en/stable/releasenotes/3.4.0.html?highlight=multitiff%20image%20save#save-multiple-frame-tiff

Displaying image link as image stored in mongodb in the ejs file

Lets say i have an image link that is stored in mongodb as a string. The image is uploaded somewhere and is accessible. How would i be able to display this thing that holds the string as an image in the ejs or html page?
For example the schema is: User.
And the name that holds the string in the database = user.characterimg
However if i would put that just like that in a ejs file it would only show the string and not the actual image.
I found the solution:
src= <%=user.characterimg%>>

Form of saving an image in Qt

I'm designing a GUI in Qt and I need to use a form to save an image. The user would be able to save a file in any location (a simple save form that we see under Save as...). How can make a save-as form in Qt?
thanks!
You can do, for example, the following:
QImage image(128, 128);
image.fill(Qt::red); // A red rectangle.
QString fileName = QFileDialog::getSaveFileName(this, tr("Save Image File"),
QString(),
tr("Images (*.png)"));
if (!fileName.isEmpty())
{
image.save(fileName);
}

iTextSharp convert to .pdf - change MIME Type

Resolved:
This had nothing to do with iTextSharp. The culprit is XMPIE and how it renders pdfs.
I'm using iTextSharp to convert .pngs to pdfs.
Here's a snippet of code:
var image = iTextSharp.text.Image.GetInstance(imageBytes);
document.Add(image);
My question is: does this actually convert the .png to a .pdf? Does it change the Mime type?
I am trying to use the converted image in XMPIE, which does not support .pngs. The "conversion" seems to work -- meaning that I get a pdf that has my image on it. But when I try to display that image in xmpie it displays all blurred out and grey. The "conversion" works with .jpegs but not .pngs.
Is there another way to convert an image (.png) to a .pdf. My code just seems to add the image to the .pdf and doesn't actually change the mime type.

How to display image blob from postgres to VB 6?

I have an application written in VB6 and would like to know how I would display an image blob from postgres to VB6?
If the image blob is in one of several standard formats (BMP, JPEG, GIF, TIFF file format) you can use WIA 2.0 for this.
Get the blob as a Byte array, create a WIA.Vector object, assign the Byte array to the Vector.BinaryData property, then you can use the Vector.Picture property to retrieve a StdPicture object you can assign to an Image or PictureBox control.
This code can help if the image can be loaded to a picture box.
See the PictureFromByteStream() Function in Module1.bas