XMGETSCALEDPIXMAP(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– XmGetScaledPixmap β€” the library call, but make it fashion πŸ’–

okay so bestie, today we're talking about XmGetScaledPixmap, a library call, and no it's not just "another pixmap function," it's the one that actually respects your printer's resolution. it's giving thoughtful. it's giving considerate. it's giving πŸŽ€


✨ NAME ✨

XmGetScaledPixmap β€” read a pixmap file and scale it according to pixmap and print resolution πŸ’…


🌸 SYNOPSIS 🌸

#include <Xm/Xm.h>
XtEnum XmGetScaledPixmap(
Widget widget,
String image_name,
Pixel foreground,
Pixel background,
int depth,
Double scaling_ratio);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜•. XmGetScaledPixmap takes its Widget argument and goes looking up the family tree for a Print Shell ancestor, so it can grab the pixmap resolution and the default printer resolution info β€” and those are the ones it's gonna use if scaling_ratio == 0. lowkey iconic behavior honestly.

So if the scaling is 0, and there's a valid PrintShell sitting up there in the ancestor chain, XmGetScaledPixmap applies a ratio that equals:

(printer resolution / default pixmap resolution)

…and it does all that before creating the Pixmap on the widget's Screen. periodt. πŸ’…

Otherwise β€” if we're not in the scaling-is-0 situation β€” the scaling_ratio you passed in gets used to scale both dimensions of the image being converted as a Pixmap. both of them. no half-measures. 🫢

And here's the glow-up: XmGetScaledPixmap completes the existing XmGetPixmapByDepth API by making use of the XmNdefaultPixmapResolution of the rooting XmPrintShell. so if you want the full deets, go read the XmGetPixmapByDepth documentation, bestie β€” it's all there. πŸ“–βœ¨

πŸ“ the arguments, one by one πŸ“

  • widget β€” the Widget used to determine the default pixmap resolution (of the print shell ancestor). it's the one doing the ancestor-hunting. main character energy fr fr. πŸ‘‘
  • image_name β€” see XmGetPixmapByDepth for description.
  • foreground β€” see XmGetPixmapByDepth for description.
  • background β€” see XmGetPixmapByDepth for description.
  • depth β€” see XmGetPixmapByDepth for description.
  • scaling_ratio β€” indicates the scaling ratio to be applied, or 0. that's it, that's the whole job. πŸŽ€

πŸ’œ RETURN VALUE πŸ’œ

Returns Pixmap, or NULL if it failed. 😭 so like… check it. always check it. ngl that's just good manners.


πŸ”₯ ERRORS/WARNINGS πŸ”₯

Same as for XmGetPixmapByDepth. that's the whole warning section, babes β€” go look at the other page if you need the full list. πŸ’€


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸ’–βœ¨ this was XmGetScaledPixmap(library call) β€” the library-call era of the manual, no cap. go forth and scale your pixmaps responsibly. mwah πŸ«ΆπŸŽ€πŸ¦‹