News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

How can I read a clipboard image?

Started by Fraile, December 05, 2019, 04:15:04 AM

Previous topic - Next topic

Fraile


hutch--

It would help if you told us what you are planning to use in terms of an assembler or compiler.

jj2007

If it's just for displaying the image:

include \masm32\MasmBasic\Res\MbGui.asm
GuiControl MyImage, "canvas"
Event CanvasPaint
  GuiImage clipboard
GuiEnd


Saving the image is much more complicated (project attached):

include \masm32\MasmBasic\Res\MbGui.asm         ; needs MasmBasic
GuiControl MyImage, "canvas"
GuiImageCallback MySave                ; tell GuiImage to call MySave

Event CanvasPaint
  GuiImage clipboard
EndOfEvents

MySave: SaveImageToFile "test.jpg"      ; can be gif, bmp, png, jpg, tiff ...
  ret
GuiEnd

Vortex

Hi AsmAlmeria12,

Here is an example for you. The code does not check the content of the clipboard so please don't forget to hit PRINT SCREEN or ALT+PRINT SCREEN before testing the application.

Fraile

thank you very much to all. The example, of vortex, is what I was looking for.  :eusa_clap: