Recent

Author Topic: [RESOLVED] Vampyre Imaging Library problems  (Read 2985 times)

NelsonN

  • Jr. Member
  • **
  • Posts: 69
    • Beam Me Up!
[RESOLVED] Vampyre Imaging Library problems
« on: March 09, 2018, 03:23:48 pm »
Just when I solve one problem another one pops-up.

I am using the Vampyre Imaging Library in an older program I am trying to get to compile with the latest Lazarus.

Here's the problem at runtime now.

When I add the Vampyre Imaging Library 0.26.4 to the project I don't get icons on components like buttons yet they operate just fine.

When I add the vampyreimaging from the Online Package Manager I see all the icons on the components, but the library function LoadImageFromStream doesn't do its function.


Code: Pascal  [Select][+][-]
  1. function TForm2.SizeThumbs(Var ImageThumbsArray: TBitbtn; Img_Copyrect: Integer;
  2.   ThumbH: Integer; ThumbW: Integer; Var ImgMS: TMemoryStream) : Integer;
  3. var
  4.   Img, Img2 : TImageData;
  5.   ImgH, ImgW : Integer;
  6.   i{, returnWidth} : Integer;
  7. begin
  8.   try
  9.     InitImage(Img);
  10.  
  11.     NewImage(ThumbW, ThumbH, ifR8G8B8, Img2);
  12.  
  13.     ImgW := 0;
  14.  
  15.     ImgMS.Position := 0;
  16.  
  17.     LoadImageFromStream(ImgMS, Img);  // DOES NOT WORK with vampyreimaging from the Online Package Manager
  18.     ImgMS.Position := 0;
  19.     ImgMs.Size := 0;

Resolved, read here:
http://forum.lazarus.freepascal.org/index.php/topic,34297.msg279263.html#msg279263
« Last Edit: March 10, 2018, 03:08:34 pm by NelsonN »
Lazarus trunk / FPC 3.0.4 / 32-bit and 64-bit with Windows 10.

benohb

  • Full Member
  • ***
  • Posts: 213
Re: Vampyre Imaging Library problems
« Reply #1 on: March 10, 2018, 06:52:11 am »

What is ImgMS ??

Must contain a magic bytes

Example
if ImgMS a bmp 
ImgMS.ReadByte 1 // 42
ImgMS.ReadByte 2 // 4D

https://en.wikipedia.org/wiki/List_of_file_signatures

NelsonN

  • Jr. Member
  • **
  • Posts: 69
    • Beam Me Up!
Re: [RESOLVED] Vampyre Imaging Library problems
« Reply #2 on: March 10, 2018, 03:09:54 pm »
Thanks for replying, the issue was resolved.
Lazarus trunk / FPC 3.0.4 / 32-bit and 64-bit with Windows 10.

 

TinyPortal © 2005-2018