Tile Image not shown - windows

I try to set my main tile with the templatew TileWide310x150SmallImageAndText02. I had a look at the sample code and took this out of it:
ITileSquare310x310SmallImagesAndTextList04 tileContent =
TileContentFactory.CreateTileSquare310x310SmallImagesAndTextList04();
tileContent.Image1.Src = "ms-appx:///Assets/Logo.png";
tileContent.TextHeading1.Text = "Cashflow";
tileContent.TextWrap1.Text = "Income: 500";
tileContent.TextWrap2.Text = "Spending: 400";
tileContent.TextWrap3.Text = "Earnings: 200";
// Create a notification for the Wide310x150 tile using one of the available templates for the size.
ITileWide310x150SmallImageAndText02 wide310x150Content =
TileContentFactory.CreateTileWide310x150SmallImageAndText02();
wide310x150Content.Image.Src = "ms-appx:///Assets/Logo.png";
wide310x150Content.TextHeading.Text = "Cashflow";
wide310x150Content.TextBody1.Text = "Income: 500";
wide310x150Content.TextBody2.Text = "Spending: 400";
wide310x150Content.TextBody3.Text = "Earnings: 200";
// Create a notification for the Square150x150 tile using one of the available templates for the size.
ITileSquare150x150PeekImageAndText01 square150x150Content =
TileContentFactory.CreateTileSquare150x150PeekImageAndText01();
square150x150Content.Image.Src = "ms-appx:///Assets/Logo.png";
square150x150Content.TextHeading.Text = "Cashflow";
square150x150Content.TextBody1.Text = "Income: 500";
square150x150Content.TextBody2.Text = "Spending: 300";
square150x150Content.TextBody3.Text = "Earnings: 200";
// Attach the Square150x150 template to the Wide310x150 template.
wide310x150Content.Square150x150Content = square150x150Content;
// Attach the Wide310x150 template to the Square310x310 template.
tileContent.Wide310x150Content = wide310x150Content;
// Send the notification to the application? tile.
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());
This will show the tile correctly in the 150x150 size, but not in the wide. Then only the text is shown but not the image.
Here's a screenshot:
Thanks for your help!
NPadrutt

The SmallImageAndText Templates only show an Image on Windows, not on Phone.
Please refer to the template catalog for the direfences here.
Tipp: Template catalog is available at aka.ms/tiletemplates

Related

add an image to given coordinates on a PDF page

How can I add an image to given coordinates (x,y) on a PDF page, using IronPdf?
Using the samples, I managed easily to add a "stamp", but that is placed in the center of the page.
I would need to be able to pass (x,y) as parameters when adding the image to each page, and I find this info nowhere in the class documentation.
var stamper = new IronPdf.Editing.ImageStamper(Image);
pdf.ApplyStamp(stamper, pageNumber);
See code above that adds the image in the page center.
You can set HorizontalOffset and VerticalOffset by IronPdf.Editing.Length .
I wrote sample code as below, hope it helps:
var pdf = new PdfDocument("./test.pdf");
ImageStamper logoImageStamper = new ImageStamper("[YOUR IMAGE PATH]/cat.jpg");
logoImageStamper.HorizontalOffset = new Length(300, MeasurementUnit.Pixel);
logoImageStamper.VerticalOffset = new Length(-500, MeasurementUnit.Pixel);
pdf.ApplyStamp(logoImageStamper);
pdf.SaveAs("test_new.pdf");
Code running effect:

How do I move QGroupbox widget to a specific portion of the dialog space?

Below is the image example of what I need to do. In this dialog how do I move the 'Record Live audio' group box to the highlighted portion? I have already tried .move(), .setgeometry(), not working.
self.setGeometry(500,500,500,500)
self.dlayout = QVBoxLayout(self)
self.gb = QGroupBox('Record Live audio')
self.gb.setFixedHeight(120)
self.dlayout.addWidget(self.gb)
self.setWindowTitle("Dialog")
duration_label = QLabel('Duration : ')
status_label = QLabel('Status :')
status_notifier = QLineEdit()
status_notifier.setFixedWidth(200)
self.duration_value = QSpinBox(self)
self.duration_value.setFixedWidth(50)
self.record_action = QAction('Record')
self.fl = QFormLayout(self)
self.fl.addRow(duration_label, self.duration_value)
self.fl.addRow(status_label, status_notifier)
self.gb.addAction(self.record_action)
self.gb.setLayout(self.fl)
self.setLayout(self.dlayout)

Why I am unable to change the QR Code's size in iText7?

How to change QR Code size?
using (iText.Kernel.Pdf.PdfReader _pdf_reader =
new iText.Kernel.Pdf.PdfReader("tmp/example.pdf"))
{
using (iText.Kernel.Pdf.PdfDocument pdfDoc = new iText.Kernel.Pdf.PdfDocument(_pdf_reader, new iText.Kernel.Pdf.PdfWriter("tmp/output.pdf").SetSmartMode(true)))
{
BarcodeQRCode qrc = new BarcodeQRCode("https://google.com");
PdfFormXObject xObject = qrc.CreateFormXObject(ColorConstants.BLACK, pdfDoc);
float _w = pdfDoc.GetPage(1).GetPageSize().GetWidth();
float _h = pdfDoc.GetPage(1).GetPageSize().GetHeight();
PdfCanvas canvas = new PdfCanvas(pdfDoc.GetPage(1));
canvas.SaveState();
canvas.SetFillColor(ColorConstants.LIGHT_GRAY);
//canvas.Rectangle(_w - 90, _h - 90, 100, 100);
canvas.Fill();
canvas.RestoreState();
canvas.AddXObject(xObject, _w - qrc.GetBarcodeSize().GetWidth(), _h - qrc.GetBarcodeSize().GetHeight());
}
}
I try:
qrc.GetBarcodeSize().GetHeight();
qrc.GetBarcodeSize().GetWidth();
it returns 33
I try to set Height & Width to 100 like below:
qrc.GetBarcodeSize().SetHeight(100);
qrc.GetBarcodeSize().SetWidth(100);
and then check the size again, but it keeps returning 33, is it a bug? or Did I miss something?
please help
thanks
Don
I try to set Height & Width to 100 like below:
Actually, you can`t change the QrCode side this way.
In fact, QRcode is an n*n grid where n depends on some parameters as a QR code version and the error correction level.
When generating, iText uses the smallest version that can fit the content. This is version 4 (33*33) in your case.
The easiest way to change the size of QrCode in a document is by using the version of the createFormXObject method which accepts the moduleSide parameter.
float moduleSize = 100/qrc.GetBarcodeSize().GetHeight();
qrc.createFormXObject(foreground, moduleSize, document)
Module size here is size of the barcode`s grid cell (1 by default).
iTxt 7 Qrcode size effected by three parameter in hints, example example for your reference.
//C# code
//Prepare all necessary properties to create the qrcode
IDictionary<EncodeHintType, Object> hints = new Dictionary<EncodeHintType, object>();
//default character set (ISO-8859-1)
hints[EncodeHintType.CHARACTER_SET] = "UTF-8";
//Qrcode Error correction level L,M,Q,H
//default ErrorCorrectionLevel.L
hints[EncodeHintType.ERROR_CORRECTION] = ErrorCorrectionLevel.L;
//Qrcode minimal version level
//default 4
hints[EncodeHintType.MIN_VERSION_NR] = 6;
string code = "Qrcode content here";
BarcodeQRCode qrcode = new BarcodeQRCode(code, hints);

Win7: Set Custom Text Size changes position of button's image

Good day all! I have a very tricky for me question.
In my application I have button with image inside. All properties of this button:
Me.cmdSelectAll.BackColor = System.Drawing.SystemColors.Control
Me.cmdSelectAll.Image = CType(resources.GetObject("cmdSelectAll.BackgroundImage"), System.Drawing.Image)
Me.cmdSelectAll.ImageAlign = Drawing.ContentAlignment.BottomRight
Me.cmdSelectAll.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdSelectAll.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdSelectAll.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdSelectAll.Location = New System.Drawing.Point(0, 282)
Me.cmdSelectAll.Name = "cmdSelectAll"
Me.cmdSelectAll.Padding = New System.Windows.Forms.Padding(0, 0, 0, 0)
Me.cmdSelectAll.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdSelectAll.Size = New System.Drawing.Size(22, 22)
Me.cmdSelectAll.TabIndex = 11
Me.cmdSelectAll.TabStop = False
Me.ToolTip1.SetToolTip(Me.cmdSelectAll, "Select All Channels")
Me.cmdSelectAll.UseVisualStyleBackColor = False
When I run it with default text size of win7, the image appears in the center, it's all ok. But when I set some custom value of text size (115%) my image suddenly goes more right and down. It occurs with all of my button's images. Could you please answer me why does this happen and how can i fix this issue? Thanks

Drupal - displaying image in theme template from iids value only

I'm trying to theme one of my content types, which has images uploaded to each instance using the image attach module.
Using the developer module, I've found the iids value of the uploaded image (eg 305), but i'm having trouble finding out how I can actually display the image in my code. This line outputs the node id of the image which has been uploaded, but how can I then use that?
$image = $node->iids[0];
I've tried using hook_image, but I can't seem to get that working...
Thanks for any help.
This did the trick...
$nodeid = $node->nid;
$get_image = db_query('
SELECT p.filepath as imagefilename
FROM {image_attach} i
LEFT JOIN {image} a ON i.iid = a.nid
LEFT JOIN {files} p ON a.fid = p.fid
WHERE i.nid = %d AND p.filename = "recipe_thumb"', $nodeid);
$obj_image = db_fetch_object($get_image);
$imagefilename = $obj_image->imagefilename;

Resources