Drag and Drop Picture Convert into Omnis

Das Goravani goravanis at gmail.com
Wed Dec 16 19:49:43 EST 2020

This code used to work for dragging and dropping a picture onto a Picture field.. today I tried JPEG and PNG and neither worked.

Does anyone have a code snippet that successfully converts a dragged picture to an Omnis picture type? 

This code used to work:

Where iv1.NPict is my final field destination and Picture is the label name on the field on the window

I stepped and checked and all the values are there.. there’s something in the binary field, the format is JPEG

On evDrop
  Set current list lvRow
  Calculate lvRow as pDragValue
  Redefine list ivPathString,ivPictFormat
  Do lvRow.$loadcols()
  ReadBinFile (ivPathString,lvBinary)
  Do pictformat(lvBinary) Returns ivPictFormat
  If len(ivPictFormat)
    Do pictconvfrom(ivPictFormat,lvBinary) Returns iv1.NPict
    Redraw Picture
  End If

More information about the omnisdev-en mailing list