ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Image Params after pasting from clipboard

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Dakota Posted - Sep 09 2011 : 12:32:05
Hi:

I am pasting from the clipboard into an ImageEnMView. My goal is to have the pasted image be appended to the end of the images in the ImgeEnMView.

The Problem is that after pasting the image, the Width and Height parameters return zero. I need to display these values on the statusbar of my form.

What am I doing wrong?

PS: I'm using the latest version of 3.x.


var
  tempBmp:  TBitmap;
  idx:  integer;
begin
  // First append an empty image to ImageEnMView  
  idx := ImageEnMView.AppendImage;
  tempBmp := TBitmap.Create;
  try
    tempBmp.Width := ImageEnMView.Width;   {this is not zero}
    tempBmp.Height := ImageEnMView.Height; {nor is this}
    tempBmp.PixelFormat := pf24bit;
    ImageEnMView.SetImage(idx, tempBmp);
  finally
    FreeAndNil(tempBmp);
  end;

  //Now paste into the image we just appended.
  ImageEnMView.Proc.PasteFromClipboard;
  
  //PROBLEM IS HERE - This shows zero instead of image width
  ShowMessage(IntToStr(ImageEnMView.MIO.Params[idx].Width)); 
  
end;

4   L A T E S T    R E P L I E S    (Newest First)
mouser Posted - Sep 30 2012 : 16:23:16
I'd like to revisit this request.

When images are read from on the clipboard, their DPI can be read by applications.

ImageEn infact is capable of storing the DPI of an image onto the clipboard when it places an image on the clipboard.

HOWEVER, ImageEn does not seem to be reading the DPI value from clipboard image data when you use the PasteFromClipboard function.

At least as far as I can tell, this is a bug.

So for example if I have a 100DPI image in ImageEn, and I copy it to clipboard with ImageEnView->Proc->CopyToClipboard, ImageEn will create a 200DPI image on the clipboard and other apps reading the clipboard will see a 200DPI image when they check the clipboard bitmap data.

BUT if i then start up an ImageEn application and try to load this image data from the clipboard using PasteFromClipboard, ImageEn does not grab the DPI information from the clipboard image data.

I'd like to request that this be fixed if possible.

Thank you for ImageEn, it's a wonderful library.
fab Posted - Sep 09 2011 : 22:39:09
quote:
Yep, that fixed it. However I am having the same issue with getting the dpi.

ImageEnMView.Mio.Params[idx].DpiX


All Params[] properties are filled only after related images are loaded from the files. If you assign them using SetImage (or Append, PasteFromClipboard, etc..) then Params[] are not touched.
Dakota Posted - Sep 09 2011 : 14:48:32
Hi:

Yep, that fixed it. However I am having the same issue with getting the dpi.

ImageEnMView.Mio.Params[idx].DpiX

Is it because the dip cannot be determined until a filetype is present?

Thanks,

Dale
fab Posted - Sep 09 2011 : 14:18:18
Hi,
image width and height are stored in ImageEnMView.ImageWidth[] and ImageEnMView.ImageHeight[] properties.

ImageEnMView.MIO.Params[].Width and Height are filled only on input/output operation.