XpSetImageResolution(3Xp)

XpSetImageResolution(3Xp) πŸ’…

okay so bestie, welcome to the XPRINT FUNCTIONS corner of the X11 universe 🫢 this page is all about XpSetImageResolution, the little function that handles image resolution before your PutImage requests. it's giving β€œvery specific job, very important vibes,” no cap ✨


✨ NAME ✨

XpSetImageResolution β€” sets the resolution for subsequent PutImage requests. that's the whole name tea πŸ’–


πŸ› οΈ SYNOPSIS πŸ› οΈ

compile situation:

cc [ flag... ] file... -lXp [ library... ]
#include <X11/extensions/Print.h>

function signature, bestie:

Bool XpSetImageResolution ( display, print_context, image_res,
       prev_res_return )
             Display * display ;
             XPContext  print_context ;
             int  image_res ;
             int * prev_res_return ;

🌸 ARGUMENTS 🌸

  • display β€” a pointer to the Display structure. literally the display hookup 🫢
  • print_context β€” the print context on which to set the resolution. that's the context getting this whole resolution moment πŸ’…
  • image_res β€” the image resolution in pixels per inch. the number that controls the scaling vibe ✨
  • prev_res_return β€” returns the previous image resolution in pixels per inch. it's the β€œwhat was it before?” receipt πŸŽ€

πŸ’– DESCRIPTION πŸ’–

XpSetImageResolution returns True if the printer server allowed the resolution to be set, otherwise False is returned. simple as that, bestie 😌

XpSetImageResolution sets the resolution for subsequent PutImage requests to the screen of the specified print context. If the return value is False, then the print server does not support image scaling for the particular resolution given the current configuration of the printer, and the application is responsible for any desired scaling. if it's False, you're on your own for scaling β€” no cap 😭

If the return value is True, then the contents of any subsequent PutImage request to a Pixmap or to a Window on the screen of the specified print context will automatically be scaled as part of the PutImage request. the scale factor is:

default_printer_resolution / image_res

Where default_printer_resolution is the current value of that page attribute. and listen β€” only the image itself is scaled (meaning the effective width and height of the image change), the dst-x and dst-y parameters to PutImage are not altered. the image changes size, the destination coords do not. periodt πŸ’…

As a special case, a value of zero for image_res resets the resolution to automatically track the printer resolution; in this case (which is also the default setting for a newly created print context), subsequent images will not be scaled. zero is the β€œjust vibe with the printer” setting πŸ¦‹

If the return value is True and prev_res_return is a non-NULL pointer, then the previous image resolution that was set for the print context is stored in prev_res_return. cute little receipt for the previous setting ✨

XpSetImageResolution returns False immediately if image_res is negative or greater than 65535. those numbers are not it, bestie β€” immediate False πŸ’€


😭 DIAGNOSTICS 😭

  • XpBadContext β€” A valid print context-id has not been set prior to making this call. if you see this, the context is not contexting, and you need a valid print context-id first πŸ™ˆ

later, bestie! 🫢 this page is from X Version 11 / libXp 1.0.4, and the footer date slot is literally not printed here β€” that's the whole sign-off vibe, and it ate πŸŽ€

πŸ“¦ where this page comes from