본문 바로가기

Delphi Tip/이미지-영상8

폼 배경에 비트맵 넣기 폼 배경에 비트맵 넣기 AnimateWindow() API함수는 폼에게 애니메이션 효과를 줄 수 있는 함수이다. 그런데, 폼에 TImage를 올려놓고 비트맵을 불러드린 다음에, 애니메이션 효과를 주면 비트맵이 보이지 않는다. 그래서 MSDN을 찾아보니, WM_PRINTCLIENT를 사용하라고 나온다. 소스참고 unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm2 = class(TForm) procedure FormShow(Sender: TObject); procedure FormCreate(Sender: TObject); procedure .. 2024. 4. 21.
BMP에 DPI값 세팅하기 및 알아오기 BMP에 DPI값 세팅 unit MyGraphic; interface uses SysUtils, Classes, Graphics, Dialogs; function GetBMPFileDPI(FileName: String): LongInt; procedure SetBMPFileDPI(FileName: String; DPI: Integer); function GetBmpDPI(Bitmap: TBitmap): LongInt; procedure SetBmpDPI(Bitmap: TBitmap; DPI: Integer); implementation function GetBMPFileDPI(FileName: String): LongInt; var Stream: TFileStream; Data: Word; A: Doub.. 2024. 1. 26.
이미지 마우스로 움직이기 이미지 마우스로 움직이기 var gx, gy : integer; procedure TForm1.image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if [ssLeft] = Shift Then Begin (Sender as TImage).Left := (Sender as TImage).Left+X-gx; (Sender as TImage).Top := (Sender as TImage).TOP+Y-gy; End; end; procedure TForm1.image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if .. 2024. 1. 4.
델파이 RGB 와 HSL 유틸 유닛 델파이 RGB 와 HSL 유틸 유닛 HSL의 의미 HSL은 컬러를 이루는 3가지 요소인 Hue (색), Saturation (채도), Lightness (명도)를 직접 조절하는 메뉴입니다. 물론 포토샵에서도 Hue / Saturation 모드를 통해 컬러를 조절할 수 있지만 라이트룸은 좀 더 직관적인 메뉴를 제공합니다. 또한 라이트룸에서는 모든 컬러를 동시에 조절하는 것이 아니라 컬러별로 미세하게 위의 요소들을 조절할 수 있기 때문에 보다 전문적인 컬러 조절을 하기 위해선 꼭 알아야 하는 메뉴입니다. unit RGBHSLUtils; interface uses Windows, Graphics, Math, Scanlines; var //set these variables to your needs, e.g. .. 2021. 10. 22.
판넬 이미지파일 저장 판넬 이미지파일 저장 TMyPanel = class(TPanel) public property Canvas; end; procedure TForm1.Button1Click(Sender: TObject); var B: TBitmap; begin B:=TBitmap.Create; B.Width:=Panel1.Width; B.Height:=Panel1.Height; B.Canvas.CopyRect(Rect(0,0,B.Width,B.Height), TMyPanel(Panel1).Canvas, Rect(0,0,B.Width,B.Height)); B.SaveToFile('panel.bmp'); B.Free; end; Panel1 - your Panel; 2021. 10. 21.
이미지(JPG) 사이즈 구하기 이미지(JPG) 사이즈 구하기 procedure GetJPGSize(const sFile: string; var wWidth, wHeight: Word); function ReadMWord(f: TFileStream): Word; type TMotorolaWord = record case Byte of 0: (Value: Word); 1: (Byte1, Byte2: Byte); end; var MW: TMotorolaWord; begin { It would probably be better to just read these two bytes in normally } { and then do a small ASM routine to swap them. But we aren't talking } { abou.. 2021. 10. 20.
Timage에 외부 이미지 파일/txt파일 드래그&드롭으로 가져오기 Timage에 외부 이미지 파일/txt파일 드래그&드롭으로 가져오기 unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, {Units Added} Vcl.Imaging.jpeg, Vcl.Imaging.pngimage, Winapi.ShellAPI; {Units Added} type TForm1 = class(TForm) edt1: TEdit; img1: TImage; mmo1: TMemo; procedure FormCrea.. 2021. 10. 19.
델파이 API 애니매이션 효과내기 API 애니매이션 효과 AnimateWindow(handle, 1000, AW_HOR_POSITIVE);//왼쪽->오른쪽 AnimateWindow(handle, 1000, AW_HOR_NEGATIVE);//오른쪽->왼쪽 AnimateWindow(handle, 1000, AW_VER_POSITIVE);//위->아래 AnimateWindow(handle, 1000, AW_VER_NEGATIVE);//아래->위 AnimateWindow(handle, 1000, AW_CENTER);//내부적으로 축소 또는 외부확장 AnimateWindow(handle, 1000, AW_HIDE);//윈도우를 숨기는 효과 AnimateWindow(handle, 1000, AW_ACTIVATE);//윈도우 활성시키는 효과 Anim.. 2021. 10. 18.