-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
sulth4nOffline
Location:
Post subject: form backgrund image dari mysql  PostPosted: 28/Feb/2006 16:01
onIntermediate


Joined: 30-Nov-2005
Posts: 46

Status: Offline
kan mysql bisa ngesave image pake blob type..iya kan?
terus untuk ngeset background dari form bisa menggunakan code ini untuk gambar yang berada di komputer local
      Code:

procedure TForm1.FormCreate(Sender: TObject);
begin
backgroundImage := TBitmap.Create;
backgroundImage.LoadFromFile(ExtractFilePath(Application.ExeName)+'background.bmp');
end;

procedure TForm1.FormPaint(Sender: TObject);
begin
Canvas.Draw( 0, 0, backgroundImage );
end;


tapi untuk mengambil dari sebuah record di mysql bisa ga pake
method
.LoadFromFile(hasil query)?

or dari mas2 sekalian ada cara yang lebih gampang?

mohon pencerahannya....
 
 View user's profile Send private message  
Reply with quote Back to top
DelphiExpert
Location:
Post subject:   PostPosted: 01/Mar/2006 08:49
onMage


Joined: 06-Feb-2006
Posts: 2401

Mr. Green Bisa pake trik berikut untuk ngeload bitmap dari Blob:

code : pascal
  1. var Bcg: TBitmap;
  2. BF: TBlobField;
  3. Buf: TStream;
  4. begin
  5. // fetch data pake query
  6. XQuery.SQL.Text:= 'SELECT IMG_FIELD FROM TABLE_NAME WHERE PK_KEY = 101';
  7. XQuery.Open;
  8.  
  9. // assign Blob field to BF
  10. BF:= XQuery.FindField('IMG_FIELD');
  11.  
  12. // create memory stream
  13. Buf:= TMemoryStream.Create;
  14. try
  15. // assign blob field data to stream
  16. BF.SaveToStream(Buf);
  17.  
  18. // reset stream pointer
  19. Buf.Seek(0, soFromBeginning);
  20.  
  21. // nah... sekarang tinggal assign Buf stream ke bitmap
  22. Bcg.LoadFromStream(Buf);
  23. finally
  24. Buf.Free;
  25. end;
  26. end;
Parsed in 0.004 seconds, using GeSHi


Simple kan, cuman ngakalin doank Mr. Green wakakak
Untuk penggunaan bitmapnya sama seperti yang kamu bikin, yang penting backgroundImage kan dah terisi dari blob field.

code : pascal
  1. Canvas.Draw(0, 0, backgroundImage);
Parsed in 0.000 seconds, using GeSHi


Ok, hope tercerahkan

Regards - D.E

_________________
Dude, if you don't understand the basics and just want to get someone else write the code for you, it means you really shouldn't study computer science. Find a different field.
http://delphiexpert.wordpress.com
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |