` Printed Icetips Article

Icetips Article



Par2: Display image (in own window)
2002-05-16 -- Lynn Howard
 
here's some C5 Clarion/Legacy code that dispalys an image in a separate
window of its own.


At Preparing to Process the Window

SETCURSOR()
  IF ImagePath <= ''
    Alarm                                   !Sound alarm
    MESSAGE('There is no image to Display','MMS',ICON:Exclamation)
    POST(EVENT:CloseWindow)
  END
  ?Image1{PROP:Text} = ImagePath
  SETPOSITION(?Image1,0,0,150,150*ImageHeight/ImageWidth)
  SETPOSITION(?Region1,0,0,150,150*ImageHeight/ImageWidth)
  WINDOW{PROP:Height} = ?Image1{PROP:Height}
  WINDOW{PROP:Width} = 150

And at Window Event Handling Sized

  Window{PROP:Height} = (ImageHeight/ImageWidth)*Window{PROP:Width}
  SETPOSITION(?Region1,,,Window{PROP:Width},Window{PROP:Height})
  SETPOSITION(?Image1,,,Window{PROP:Width},Window{PROP:Height})



Printed April 28, 2024, 6:57 am
This article has been viewed/printed 35118 times.