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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Image Params after pasting from clipboard
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Dakota

USA
8 Posts

Posted - Sep 09 2011 :  12:32:05  Show Profile  Reply
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;

fab

1310 Posts

Posted - Sep 09 2011 :  14:18:18  Show Profile  Reply
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.
Go to Top of Page

Dakota

USA
8 Posts

Posted - Sep 09 2011 :  14:48:32  Show Profile  Reply
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
Go to Top of Page

fab

1310 Posts

Posted - Sep 09 2011 :  22:39:09  Show Profile  Reply
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.
Go to Top of Page

mouser

22 Posts

Posted - Sep 30 2012 :  16:23:16  Show Profile  Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: