• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - mos

1
I have the necessity to store in a buffer the bits image so I use this code:


  ...
    FBitmap: TImagingBitmap;
    FImage: TSingleImage;
    s: LongInt;
    gbuff: Pointer;
  ...

  FImage := TSingleImage.Create;
  FBitmap := TImagingBitmap.Create;
  Image.Picture.Graphic := FBitmap;
  ...
  FImage.LoadFromFile('test.jpg');
  Image.Picture.Graphic.Assign(FImage);
  s := FImage.Size;
  GetMem(gbuff, s);
  {$ifdef Linux}
  Move(FImage.Bits, gbuff, s);
  {$endif}
  {$ifdef Win32}
  CopyMemory(gbuff, FImage.Bits, s);
  {$endif}


The code work well under Windows but under Linux I get an exception on Move instruction.

I use Lazarus 0.9.26 & fpc 2.2.2, WinXP+SP2, Linux Fedora Core 8.

In the attached file there is the complete source code.


Can you help me?

Thanks & goodbye
2
Help & Questions / Jpeg2000 and Mac OSX
31 May 2009, 16:46:25
I have tried to porting JPEG2000 under Mac OSX.

From the package http://www.openjpeg.org/openjpeg_v1_3_osx.zip I have extract two file

libopenjpeg.dylib,
libopenjpeg.a

and put these on follow directory

(Imaging Root)\Source\Extras\Extensions\J2KObjects

with others library. Then I have modified the file (Imaging Root)\Source\Extras\Extensions\OpenJpeg.pas
to load the static library (see attached OpenJpeg.pas).

But when execute the program in attached project, I obtain an exception error, see screenshot.


Can you help me?


Thanks and goodbye
3
Help & Questions / Lazarus, Vampyre & MacOS?
22 October 2008, 19:32:37
Granted that I have not a Mac, but it's possible to compile Vampyre Library under MacOS with Lazarus?


Thanks
4
I'm trying to draw a line on an instance of TImage,  I have wrote this code with Lazarus 0.9.25:


procedure TForm1.FormCreate(Sender: TObject);
begin
  Form1.Color := clBlack;

  FImage1 := TSingleImage.Create;
  FBitmap1 := TImagingBitmap.Create;
  Image1.Picture.Graphic := FBitmap1;
  FImage1.LoadFromFile('Tigers.jpg');
  Image1.Picture.Graphic.Assign(FImage1);
 
  Image1.Picture.Bitmap.Canvas.Pen.Color := clWhite;
  Image1.Picture.Bitmap.Canvas.Line(0, 0, 200, 200);
end;


where Image TImage type on Form1 of TForm.

This code work ok on Linux (Fedora), I see a white line, but on Windows (WinXP) I see a black line.
If I set "Form1.Color := clRed;" on Windows I see a red line, in Linux is always ok, I see a white line.

In conclusion, in Windows the line color is the same of the Form color, Why?

Can you help me?


Goodbye
5
I want 2 Image (Image1, Image2) of TImage type, one (Image2, foreground) overlaying the other (Image1, background).
The Image1 must contain a Jpeg image, the Image2 must be a transparent (on clBlack color) bitmap over the user can draw lines.

I have write the following code, but this not work, what I obtain is a black image over a background image, but where the white line I draw is transparent!
Instead what I want is a white line over background image.

Can you help me?


Thanks



source code:

unit Unit1;

{$I ImagingOptions.inc}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  StdCtrls,
  ImagingTypes,
  Imaging,
  ImagingClasses,
  ImagingComponents,
  ImagingCanvases,
  ImagingUtility;

type

  { TForm1 }

  TForm1 = class(TForm)
    Image1: TImage;
    Image2: TImage;

  private
    { private declarations }
  public
    { public declarations }
    FBitmap1: TImagingBitmap;
    FImage1: TMultiImage;
   
    FBitmap2: TImagingBitmap;
    FImage2: TMultiImage;

  end;

var
  Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  FImage1 := TMultiImage.Create;
  FBitmap1 := TImagingBitmap.Create;
  Image1.Picture.Graphic := FBitmap1;
 
  FImage1.LoadMultiFromFile('e:\background.jpg'); // my background image
  Image1.Picture.Graphic.Assign(FImage1);
 
  FImage2 := TMultiImage.Create;
  FBitmap2 := TImagingBitmap.Create;

  Image2.Picture.Graphic := FBitmap2;
  FImage2.LoadMultiFromFile('e:\foreground.bmp'); // my foreground image, a black bitmap of same dimension of background image

  Image2.Picture.Graphic.Assign(FImage2);
  Image2.Picture.Bitmap.Transparent := True;
  Image2.Picture.Bitmap.TransparentColor := clBlack;

  Image2.Canvas.Pen.Color := clWhite;
  Image2.Canvas.Line(0, 0, 200, 200);

end;

initialization
  {$I Unit1.lrs}

end.


6
I compile the demo project \Imaging\Demos\ObjectPascal\LCLImager with Lazarus 0.9.25 under WinXPSP2 but I obtain the following error:

E:\SVILUPPO\Imaging\Source\ImagingComponents.pas(117,14) Error: There is no method in an ancestor class to be overridden: "TImagingGraphicForSave.GetDefaultMimeType:AnsiString"

Can you help me?


Goodbye & thanks
SMF spam blocked by CleanTalk