Quick Search for:  in language:    
includes,source,code,Rotating,Picture,Degrees
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
AniViewer
By Jerrame Hertz on 6/30


Click here to see a screenshot of this code!Raw Packet Sniffer
By Coding Genius on 6/30

(Screen Shot)

Check the support of a record set
By Freebug on 6/30


B++ Builder - VB without runtimes
By Anthonius on 6/30


Mr Blonde - Chat Program
By Mr Blonde on 6/30


MSN Messenger Status Detector
By Ryan Cain on 6/30


MSN advanced
By alias1990 on 6/30


MSN Messenger advanced
By alias1990 on 6/30


Locate Database
By Erica Ziegler-Roberts on 6/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Picture Commands

Print
Email
 

Submitted on: 4/22/1999
By: Michael Canejo  
Level: Advanced
User Rating: By 101 Users
Compatibility:VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 8668 times.
 

(About the author)
 
     This includes the source code for Rotating a Picture 45 Degrees, Flipping a Picture Horizontally, and Flipping a Picture Vertically! Very usefull if your working on your own picture editing program. <br>Questions: mikecanejo@Hotmail.com
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Picture Commands
' Description:This includes the source c
'     ode for Rotating a Picture 45 Degrees, F
'     lipping a Picture Horizontally, and Flip
'     ping a Picture Vertically! Very usefull 
'     if your working on your own picture edit
'     ing program. <br>Questions: mikeca
'     nejo@Hotmail.com
' By: Michael Canejo
'
' Assumes:'Please follow these simple st
'     eps. DONT SKIP ANYTHING!
'1.) Make a New Project in your 32bit Vi
'     sual Basic
'2.) Add a New Module(Module1.Bas) to th
'     e New Project
'3.) Add a PictureBox to the Form(Pictur
'     e1)and Insert a Picture in the 'PictureB
'     ox
'4.) Add a PictureBox to the Form(Pictur
'     e2)and keep it blank
'5.) Add a CommandButton to the Form(Com
'     mand1)
'6.) Add a CommandButton to the Form(Com
'     mand2)
'7.) Add a CommandButton to the Form(Com
'     mand3)
'Thats it, hope you followed EVERY step.
'     
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=1606&lngWId;=1'for details.'**************************************

'Ok, now just Copy and Paste everything 
'     here into the Form1..not in the Bas!
'<Start Copying>

Private Sub Command1_Click()

'flip horizontal Picture2.Cls px% = Picture1.ScaleWidth py% = Picture1.ScaleHeight retval% = StretchBlt(Picture2.hdc, px%, 0, -px%, py%, Picture1.hdc, 0, 0, px%, py%, SRCCOPY) End Sub
Private Sub Command2_Click()
'flip vertical Picture2.Cls px% = Picture1.ScaleWidth py% = Picture1.ScaleHeight retval% = StretchBlt(Picture2.hdc, 0, py%, px%, -py%, Picture1.hdc, 0, 0, px%, py%, SRCCOPY) End Sub
Private Sub Command3_Click()
'rotate 45 degrees Picture2.Cls Call bmp_rotate(Picture1, Picture2, 3.14 / 4) End Sub
Private Sub Form_Load()
Command1.Caption = "Flip Horizontal" Command2.Caption = "Flip Vertical" Command3.Caption = "Rotate 45 Degrees" Picture1.ScaleMode = 3 Picture2.ScaleMode = 3 End Sub
'<Stop Copying...END>


Other 45 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
5/2/1999 5:04:00 PM:Henry Franklin
Hey cool code Mike. Im working 
on
making my own Picture 
Developement
software and this is a 
big help.
Who knwos, ill probobly make 
an
program just like  ADOBE :-)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/3/1999 2:07:00 PM:gary noell
I am using this code to invert images.  
I would like to save the inverted 
images to a new directory.  Can you 
help?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/4/1999 4:03:00 PM:Yura Korneev
Thanks! I maked "Diffuse" effect 
while
 learned from your example. Now 
i know and
understand how to make a 
lot of effects.
Good source, keep it 
that way.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 7:52:00 AM:NAM
You Should have demonstrations so we 
could view your code and understand it 
here!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 8:25:00 AM:Adnan Yousuf
Hay this code really works.. It gave 
alot of  help in the development of my 
own Picture editor
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/9/1999 4:23:00 PM:Minhaj Arifin
Dear Sir, 
I thank you for  your 
generosity,kindly inform me how it is 
possible to move controls across a form 
in slow motion. 
Minhaj Arifin
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/10/1999 1:13:00 AM:David
I'm new to vb5 and im trying to make my 
pictures show so they take and show 1 
image for 5 seconds then goto another 
how can i do this if you could help me 
thanks you  And if anyone has a bas for 
excite chat or icq could you send 
please want to make some personal 
affects to it thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/10/1999 3:29:00 AM:Partono
I want to develop a security system for 
my application built by VB 6.0. The 
security I want is that can be detect 
the user when login and then grayed 
some menu that user can't access. If 
you have source code for helping me, 
I'll be very grateful. Thanks.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/1999 4:57:00 AM:user
This is depressing.  using setpixel is 
so long on big picutres.  And using 
setpixel is chince.  Tell me when you 
can do it a real way
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/19/1999 5:51:00 PM:Diamante
Nice code !!! But, tell me, how can i 
save the DC's bitmap in my HD ??
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/22/1999 10:22:00 AM:Vbmaster
About SAVING the result picture, try 
setting [Picturebox].Picture = 
[Picturebox].Image, and then u will be 
able to save the picture with 
SavePicture method.. i think
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/23/1999 5:07:00 AM:dharma
hey the code is is real cool.Some one 
who can help alittle . 
.How can you 
separate the 
primary colors from a 
given color.
please with a little 
lucid explanation.
Thanx a lot.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/27/1999 6:13:00 PM:Harry Noche
You have very helpful codes. Maybe
you 
can help us develop an imaging 
software capable of accessing 
the
database like SQL, Oracle and 
JASMINE,
and scanned picture 
files.
What's more interesting is that 
it must
have some character 
recognition, able to
correct some 
invalid characters in the
picture. I 
hope we could here from you
very soon. 
Thanks and more power!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/28/1999 2:28:00 PM:Sz Levente
 My question is:
How to use asm 
commands in vb 5.0 ?
If you have an 
answer, please send my also.
Thanks'
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/30/1999 6:33:00 AM:Yura Korneev
Yes code little slow, but using it i 
developed
my own image format. Now i'm 
working on
analyzing colors in image 
and programing compression 
alghoritm
same as used in JPEG images.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/1/1999 11:44:00 AM:Gnorran
How to save pictures you have 
manipulated with
different API's or 
functions ?
Simply do: 
SavePicture 
Picture1.Image,"C:\Image.bmp"
Notice 
the .IMAGE ? 
set autoredraw = true 
and it should work fine...
// Gnorran
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/18/1999 5:29:00 AM:vbmaniac
T H A N K   y o u 
Gnorran!!!!!!!!!!!!!!!!!!!!!!!!!!!!
but
 i have a question :How can i import 
scanned pictures from my 
scanner]
again thank you
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/12/1999 6:17:00 PM:Finog (Master Programmer?)
Nifty code, it sure beats using the 
point and reverse methods.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/5/1999 12:46:00 PM:Ryan
Sheesh!  It just seems like all you 
people come here and post a message for 
someone to help you!!  Try figuring it 
out on your own (VB Help files are a 
start)... if you have, maybe try adding 
some grammar and punctuation to your 
message and tell us you have tried.  I 
don't like helping people that won't 
even try.  We have lives too you know! 
:)  By the way... nice code!  My way 
was much worse!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/24/1999 4:35:00 PM:Steve
Is there a way to do this using the 
KeyDown Event?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/15/2000 4:54:29 AM:smiffe927563
nice code when you hit command button 3 
it angles the picture ok but the 
picture box cuts off the corners of the 
picture.  To solve this i added these 
two lines to 
command3_click()
Picture2.Width = 
Sqr((Picture1.Width * Picture1.Width) + 
(Picture1.Height * 
Picture1.Height))
Picture2.Height = 
((Sin(3.14 / 4) * Picture1.Height) + 
(Sin(3.14) * Picture1.Width))
I 
added these two lines before the 
bmp_rotate call  and it seems to 
work
if anybody knows a better way 
to do this pleas let me know 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/13/2002 11:19:55 AM:
what code i had to put in the Moudle 
file so the rarte program can work !?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/13/2002 11:20:05 AM:
what code i had to put in the Moudle 
file so the rotate program can work !?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.